Documentation ¶
Index ¶
Constants ¶
const ( // LogNone forbids any log entries LogNone int = iota // LogInfo sets the logging verbosity to info LogInfo // LogDebug sets the logging verbosity to debug LogDebug )
Variables ¶
var DefaultLevel = LogInfo
DefaultLevel is the default level where statements are logged. Change the value of this variable before init() to change the level of the default logger.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface { Info(keyvals ...interface{}) Debug(keyvals ...interface{}) Warn(keyvals ...interface{}) Error(keyvals ...interface{}) Fatal(keyvals ...interface{}) // With returns a new Logger that inserts the given key value pairs for each // statements at each levels With(keyvals ...interface{}) Logger }
Logger is a interface that can log to different levels.
var DefaultLogger Logger
DefaultLogger is the default logger that only statemetns at the default level. The level is set by DefaultLevel inside init()..
func NewKitLogger ¶
NewKitLogger returns a Logger based on go-kit/kit/log default logger structure that outputs to stdout. You can pass in options to only allow certain levels. By default, it also includes the caller stack.
func NewKitLoggerFrom ¶
NewKitLoggerFrom returns a Logger out of a go-kit/kit/log logger interface. The caller can set the options that it needs to the logger first. By default, it wraps the logger with a SyncLogger so concurrent calls are synchronized.