Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReplaceGlobals ¶
func ReplaceGlobals(logger Logger) func()
ReplaceGlobals replaces the global Logger and returns a function to restore the original values. It's safe for concurrent use.
Types ¶
type Fields ¶
type Fields map[string]interface{}
Fields Type to pass when we want to call WithFields for structured logging
type Logger ¶
type Logger interface { // Debug uses fmt.Sprint to construct and log a message. Debug(args ...interface{}) // Info uses fmt.Sprint to construct and log a message. Info(args ...interface{}) // Warn uses fmt.Sprint to construct and log a message. Warn(args ...interface{}) // Error uses fmt.Sprint to construct and log a message. Error(args ...interface{}) // Panic uses fmt.Sprint to construct and log a message, then panics. Panic(args ...interface{}) // Fatal uses fmt.Sprint to construct and log a message, then calls os.Exit. Fatal(args ...interface{}) // Debugf uses fmt.Sprintf to log a templated message. Debugf(template string, args ...interface{}) // Infof uses fmt.Sprintf to log a templated message. Infof(template string, args ...interface{}) // Warnf uses fmt.Sprintf to log a templated message. Warnf(template string, args ...interface{}) // Errorf uses fmt.Sprintf to log a templated message. Errorf(template string, args ...interface{}) // Panicf uses fmt.Sprintf to log a templated message, then panics. Panicf(template string, args ...interface{}) // Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit. Fatalf(template string, args ...interface{}) WithFields(keyValues Fields) Logger }
Logger is our contract for the logger
func L ¶
func L() Logger
L returns the global Logger, which can be reconfigured with ReplaceGlobals. It's safe for concurrent use.
func NewLogrusLogger ¶
NewLogrusLogger create new logger using logrus logger
Click to show internal directories.
Click to hide internal directories.