Documentation ¶
Overview ¶
Package log implements convenience functionality on top of the Go kit logging package github.com/go-kit/log.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger wraps a Logger from package github.com/go-kit/log to provide a more convenient way to log with a particular level. Note that Logger still implements the Logger interface from github.com/go-kit/log.
func DefaultJSONLogger ¶
Default logger that encodes log events as a single json object and writes them to stdout.
There are four different log levels: error/warn/info/debug (in descending order of severity). An option can be passed to filter out log messages below a certain level. E.g. if AllowInfo is passed, only log messages with level info/warn/error or without a level will be logged. By default only log messages with or above level info are logged.
type Option ¶
type Option string
const AllowDebug Option = "allowDebug"
const AllowError Option = "allowError"
const AllowInfo Option = "allowInfo"
const AllowWarn Option = "allowWarn"
const PrettyPrint Option = "prettyPrint"
Pretty print JSON log events, i.e. as multiple indented lines. Useful for development and testing.