Documentation
¶
Overview ¶
Package gokitlogr defines an implementation of the github.com/go-logr/logr interfaces built on top of go-kit/log (https://github.com/go-kit/log).
Usage ¶
A new logr.Logger can be constructed from an existing log.Logger using the New function:
log := gokitlogr.New(someGoKitLogger)
Implementation Details ¶
For the most part, concepts in go-kit/log correspond directly with those in logr.
Levels in logr correspond to custom debug levels in go-kit/log. V(0) and V(1) are equivalent to go-kit/log's Info level, while V(2) is equvalent to go-kit/log's Debug level. The Warn level is unused.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // NameFieldKey is the field key for logr.WithName NameFieldKey = "logger" // NameSeparator separates names for logr.WithName NameSeparator = "/" // ErrorFieldKey is the field key for logr.Error ErrorFieldKey = "error" // CallerFieldKey is the field key for call site information // When using LogfmtLogger, this should be set to a different key // than configured in go-kit/log.Logger to represent the true value // of WithCallDepth call sites. // When using JSONLogger, this should be set to the same key // configured in go-kit/log.Logger to overwrite it with the true value // of WithCallDepth call sites. CallerFieldKey = "caller" )
TODO: as options, see: https://github.com/go-logr/zapr/blob/master/zapr.go#L245
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.