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 ¶
func SetDefaultLogger ¶ added in v1.1.2
SetDefaultLogger updates the default logger to wrap a provided kit logger.
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.
func DefaultLogger ¶
func DefaultLogger() Logger
DefaultLogger is the default logger that only logs at the `DefaultLevel`.
func NewKitLogger ¶
NewKitLogger returns a Logger based on go-kit/kit/log default logger structure that outputs to stderr. 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. The underlying logger should already be synchronized.