Documentation ¶
Overview ¶
package zapr defines an implementation of the github.com/go-logr/logr interfaces built on top of Zap (go.uber.org/zap).
Usage ¶
A new logr.Logger can be constructed from an existing zap.Logger using the NewLogger function:
log := zapr.NewLogger(someZapLogger)
Implementation Details ¶
For the most part, concepts in Zap correspond directly with those in logr.
Unlike Zap, all fields *must* be in the form of suggared fields -- it's illegal to pass a strongly-typed Zap field in a key position to any of the log methods.
Levels in logr correspond to custom debug levels in Zap. Any given level in logr is represents by its inverse in zap (`zapLevel = -1*logrLevel`). For example V(2) is equivalent to log level -2 in Zap, while V(1) is equivalent to Zap's DebugLevel.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.