Documentation ¶
Index ¶
Constants ¶
View Source
const All = Level("all")
All specifies all messages should be written. It is an alias for Debug.
View Source
const Debug = Level("debug")
Debug specifies that only messages of Level Info, Warn, Debug or Error are written
View Source
const Error = Level("error")
Error specifies that only messages of Level Error are written
View Source
const Info = Level("info")
Error specifies that only messages of Level Info, Warn, or Error are written
View Source
const Warn = Level("warn")
Warn specifies that only messages of Level Error or Warn are written
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface { // Info writes Info level logs of key/value pairs InfoWithData(keyvals ...interface{}) // InfoWithMessage writes Info level logs of key/value pairs. The msg is written with a key of "msg". Info(msg string, keyvals ...interface{}) // Warn writes Warn level logs of key/value pairs WarnWithData(keyvals ...interface{}) // WarnWithMessage writes Warn level logs of key/value pairs. The msg is written with a key of "msg". Warn(msg string, keyvals ...interface{}) // Error writes Error level logs of key/value pairs. err is written with a key of "err". ErrorWithData(err error, keyvals ...interface{}) // ErrorWithMessage writes Error level logs of key/value pairs. err is written with a key of "err". The msg is written with a key of "msg". Error(err error, msg string, keyvals ...interface{}) // Debug writes Debug level logs of key/value pairs DebugWithData(keyvals ...interface{}) // DebugWithMessage writes Debug level logs of key/value pairs. The msg is written with a key of "msg". Debug(msg string, keyvals ...interface{}) // FatalError writes an Error level message and the calls os.Exit(1) if err is not nil. The "fataL" key value will be "true". FatalError(err error, keyvals ...interface{}) }
Logger is a basic logging interface for a structured logger.
func NewLogger ¶
NewLogger creates a new instance of Logger using the specified Level as the lowest level that will be logged.
func NewNullLogger ¶
func NewNullLogger() Logger
NewNullLogger returns a no op logger. Useful if your testing code that has a Logger dependency.
Click to show internal directories.
Click to hide internal directories.