Documentation ¶
Index ¶
- Variables
- func AddHook(hook logrus.Hook)
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Debugln(args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Errorln(args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Fatalln(args ...interface{})
- func GetLevel() logrus.Level
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func Infoln(args ...interface{})
- func Panic(args ...interface{})
- func Panicf(format string, args ...interface{})
- func Panicln(args ...interface{})
- func Print(args ...interface{})
- func Printf(format string, args ...interface{})
- func Println(args ...interface{})
- func SetFormatter(formatter logrus.Formatter)
- func SetLevel(level logrus.Level)
- func SetOutput(out io.Writer)
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- func Warning(args ...interface{})
- func Warningf(format string, args ...interface{})
- func Warningln(args ...interface{})
- func Warnln(args ...interface{})
- type Config
- type Entry
- type Fields
- type Logger
- func (logger *Logger) Copy(prefix ...string) *Logger
- func (logger *Logger) Debug(args ...interface{})
- func (logger *Logger) Debugf(format string, args ...interface{})
- func (logger *Logger) Debugln(args ...interface{})
- func (logger *Logger) Error(args ...interface{})
- func (logger *Logger) Errorf(format string, args ...interface{})
- func (logger *Logger) Errorln(args ...interface{})
- func (logger *Logger) Fatal(args ...interface{})
- func (logger *Logger) Fatalf(format string, args ...interface{})
- func (logger *Logger) Fatalln(args ...interface{})
- func (logger *Logger) Info(args ...interface{})
- func (logger *Logger) Infof(format string, args ...interface{})
- func (logger *Logger) Infoln(args ...interface{})
- func (logger *Logger) Panic(args ...interface{})
- func (logger *Logger) Panicf(format string, args ...interface{})
- func (logger *Logger) Panicln(args ...interface{})
- func (logger *Logger) Prefix() string
- func (logger *Logger) Print(args ...interface{})
- func (logger *Logger) Printf(format string, args ...interface{})
- func (logger *Logger) Println(args ...interface{})
- func (logger Logger) SetCallDepthOffset(offset int) *Logger
- func (logger *Logger) Warn(args ...interface{})
- func (logger *Logger) Warnf(format string, args ...interface{})
- func (logger *Logger) Warning(args ...interface{})
- func (logger *Logger) Warningf(format string, args ...interface{})
- func (logger *Logger) Warningln(args ...interface{})
- func (logger *Logger) Warnln(args ...interface{})
- func (logger *Logger) WithError(err error) *Entry
- func (logger *Logger) WithField(key string, value interface{}) *Entry
- func (logger *Logger) WithFields(fields Fields) *Entry
Constants ¶
This section is empty.
Variables ¶
var (
DefaultTimestampFormat = ""
)
Functions ¶
func Debug ¶
func Debug(args ...interface{})
Debug logs a message at level Debug on the standard logger.
func Debugf ¶
func Debugf(format string, args ...interface{})
Debugf logs a message at level Debug on the standard logger.
func Debugln ¶
func Debugln(args ...interface{})
Debugln logs a message at level Debug on the standard logger.
func Error ¶
func Error(args ...interface{})
Error logs a message at level Error on the standard logger.
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf logs a message at level Error on the standard logger.
func Errorln ¶
func Errorln(args ...interface{})
Errorln logs a message at level Error on the standard logger.
func Fatal ¶
func Fatal(args ...interface{})
Fatal logs a message at level Fatal on the standard logger.
func Fatalf ¶
func Fatalf(format string, args ...interface{})
Fatalf logs a message at level Fatal on the standard logger.
func Fatalln ¶
func Fatalln(args ...interface{})
Fatalln logs a message at level Fatal on the standard logger.
func Info ¶
func Info(args ...interface{})
Info logs a message at level Info on the standard logger.
func Infof ¶
func Infof(format string, args ...interface{})
Infof logs a message at level Info on the standard logger.
func Infoln ¶
func Infoln(args ...interface{})
Infoln logs a message at level Info on the standard logger.
func Panic ¶
func Panic(args ...interface{})
Panic logs a message at level Panic on the standard logger.
func Panicf ¶
func Panicf(format string, args ...interface{})
Panicf logs a message at level Panic on the standard logger.
func Panicln ¶
func Panicln(args ...interface{})
Panicln logs a message at level Panic on the standard logger.
func Print ¶
func Print(args ...interface{})
Print logs a message at level Info on the standard logger.
func Printf ¶
func Printf(format string, args ...interface{})
Printf logs a message at level Info on the standard logger.
func Println ¶
func Println(args ...interface{})
Println logs a message at level Info on the standard logger.
func SetFormatter ¶
SetFormatter sets the standard logger formatter.
func Warn ¶
func Warn(args ...interface{})
Warn logs a message at level Warn on the standard logger.
func Warnf ¶
func Warnf(format string, args ...interface{})
Warnf logs a message at level Warn on the standard logger.
func Warning ¶
func Warning(args ...interface{})
Warning logs a message at level Warn on the standard logger.
func Warningf ¶
func Warningf(format string, args ...interface{})
Warningf logs a message at level Warn on the standard logger.
Types ¶
type Config ¶
type Config struct { Output string Level string Verbose bool DisableColors bool Prefix string ShowCaller bool CallPathLength int // negative means whole path // contains filtered or unexported fields }
Config type.
func (*Config) OutputWriter ¶
OutputWriter returns a io.Writer according to the config.
type Entry ¶
Entry proxies the logrus.Entry to remove namespace dependency
func WithError ¶
WithError creates an entry from the standard logger and adds an error to it, using the value defined in ErrorKey as key.
func WithField ¶
WithField creates an entry from the standard logger and adds a field to it. If you want multiple fields, use `WithFields`.
Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal or Panic on the Entry it returns.
func WithFields ¶
WithFields creates an entry from the standard logger and adds multiple fields to it. This is simply a helper for `WithField`, invoking it once for each field.
Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal or Panic on the Entry it returns.
func (*Entry) WithFields ¶
WithFields is the proxy of entry.WithFields
type Logger ¶
Logger is the wrapper of logrus Logger
func StandardLogger ¶
func StandardLogger() *Logger
func (*Logger) Debug ¶
func (logger *Logger) Debug(args ...interface{})
Debug is the proxy of logger.Debug()
func (*Logger) Debugln ¶
func (logger *Logger) Debugln(args ...interface{})
Debugln is the proxy of logger.Debugln()
func (*Logger) Error ¶
func (logger *Logger) Error(args ...interface{})
Error is the proxy of logger.Error()
func (*Logger) Errorln ¶
func (logger *Logger) Errorln(args ...interface{})
Errorln is the proxy of logger.Errorln()
func (*Logger) Fatal ¶
func (logger *Logger) Fatal(args ...interface{})
Fatal is the proxy of logger.Fatal()
func (*Logger) Fatalln ¶
func (logger *Logger) Fatalln(args ...interface{})
Fatalln is the proxy of logger.Fatalln()
func (*Logger) Info ¶
func (logger *Logger) Info(args ...interface{})
Info is the proxy of logger.Info()
func (*Logger) Infoln ¶
func (logger *Logger) Infoln(args ...interface{})
Infoln is the proxy of logger.Infoln()
func (*Logger) Panic ¶
func (logger *Logger) Panic(args ...interface{})
Panic is the proxy of logger.Panic()
func (*Logger) Panicln ¶
func (logger *Logger) Panicln(args ...interface{})
Panicln is the proxy of logger.Panicln()
func (*Logger) Print ¶
func (logger *Logger) Print(args ...interface{})
Print is the proxy of logger.Print()
func (*Logger) Println ¶
func (logger *Logger) Println(args ...interface{})
Println is the proxy of logger.Println()
func (Logger) SetCallDepthOffset ¶
SetCallDepthOffset sets call depth offset if config.ShowCaller is set.
func (*Logger) Warn ¶
func (logger *Logger) Warn(args ...interface{})
Warn is the proxy of logger.Warn()
func (*Logger) Warning ¶
func (logger *Logger) Warning(args ...interface{})
Warning is the proxy of logger.Warning()
func (*Logger) Warningln ¶
func (logger *Logger) Warningln(args ...interface{})
Warningln is the proxy of logger.Warningln()
func (*Logger) Warnln ¶
func (logger *Logger) Warnln(args ...interface{})
Warnln is the proxy of logger.Warnln()
func (*Logger) WithError ¶
WithError adds an error as single field to the log entry. All it does is call `WithError` for the given `error`.
func (*Logger) WithField ¶
WithField adds a field to the log entry, note that you it doesn't log until you call Debug, Print, Info, Warn, Fatal or Panic. It only creates a log entry. If you want multiple fields, use `WithFields`.
func (*Logger) WithFields ¶
WithFields adds a struct of fields to the log entry. All it does is call `WithField` for each `Field`.