Documentation
¶
Overview ¶
Package dflog wrap around logrus to supply capturing current line and function
Index ¶
- Variables
- type Entry
- type Fields
- type Level
- type Logger
- func (l Logger) Debug(args ...interface{})
- func (l Logger) Debugf(format string, args ...interface{})
- func (l Logger) Debugln(args ...interface{})
- func (l Logger) Error(args ...interface{})
- func (l Logger) Errorf(format string, args ...interface{})
- func (l Logger) Errorln(args ...interface{})
- func (l Logger) Fatal(args ...interface{})
- func (l Logger) Fatalf(format string, args ...interface{})
- func (l Logger) Fatalln(args ...interface{})
- func (l Logger) Info(args ...interface{})
- func (l Logger) Infof(format string, args ...interface{})
- func (l Logger) Infoln(args ...interface{})
- func (l Logger) Log(level Level, msg string, err error, fields Fields)
- func (l Logger) Panic(args ...interface{})
- func (l Logger) Panicf(format string, args ...interface{})
- func (l Logger) Panicln(args ...interface{})
- func (l Logger) Print(args ...interface{})
- func (l Logger) Printf(format string, args ...interface{})
- func (l Logger) Println(args ...interface{})
- func (l Logger) SetFormatter(formatter log.Formatter)
- func (l Logger) SetLevel(level log.Level)
- func (l Logger) SetOutput(out io.Writer)
- func (l Logger) Warn(args ...interface{})
- func (l Logger) Warnf(format string, args ...interface{})
- func (l Logger) Warning(args ...interface{})
- func (l Logger) Warningf(format string, args ...interface{})
- func (l Logger) Warningln(args ...interface{})
- func (l Logger) Warnln(args ...interface{})
- func (l Logger) WithError(err error) Entry
- func (l Logger) WithField(key string, value interface{}) Entry
- func (l Logger) WithFields(fields map[string]interface{}) Entry
- func (l Logger) WithStack(err error) Entry
- type M
Constants ¶
This section is empty.
Variables ¶
var AllLevels = []Level{ PanicLevel, FatalLevel, ErrorLevel, WarnLevel, InfoLevel, DebugLevel, }
AllLevels is constants exposing all logging levels
Functions ¶
This section is empty.
Types ¶
type Entry ¶
Entry wraps logrus.Entry
func (Entry) WithFields ¶
WithFields implements logrus Entry method WithFields.
type Level ¶
type Level uint8
Level type
const ( // PanicLevel level, highest level of severity. Logs and then calls panic with the // message passed to Debug, Info, ... PanicLevel Level = iota // FatalLevel level. Logs and then calls `os.Exit(1)`. It will exit even if the // logging level is set to Panic. FatalLevel // ErrorLevel level. Logs. Used for errors that should definitely be noted. // Commonly used for hooks to send errors to an error tracking service. ErrorLevel // WarnLevel level. Non-critical entries that deserve eyes. WarnLevel // InfoLevel level. General operational entries about what's going on inside the // application. InfoLevel // DebugLevel level. Usually only enabled when debugging. Very verbose logging. DebugLevel )
These are the different logging levels. You can set the logging level to log on your instance of logger, obtained with `logrus.New()`.
type Logger ¶
type Logger struct { DebugMode bool // contains filtered or unexported fields }
Logger wraps logrus.Logger
func (Logger) Debugln ¶
func (l Logger) Debugln(args ...interface{})
Debugln implements logrus Debugln.
func (Logger) Errorln ¶
func (l Logger) Errorln(args ...interface{})
Errorln implements logrus Errorln.
func (Logger) Fatalln ¶
func (l Logger) Fatalln(args ...interface{})
Fatalln implements logrus Fatalln.
func (Logger) Panicln ¶
func (l Logger) Panicln(args ...interface{})
Panicln implements logrus Panicln.
func (Logger) Println ¶
func (l Logger) Println(args ...interface{})
Println implements logrus Println.
func (Logger) SetFormatter ¶
SetFormatter sets formatter for logger.
func (Logger) Warning ¶
func (l Logger) Warning(args ...interface{})
Warning implements logrus Warning.
func (Logger) Warningln ¶
func (l Logger) Warningln(args ...interface{})
Warningln implements logrus Warningln.
func (Logger) WithFields ¶
WithFields implements logrus WithFields.