Documentation ¶
Overview ¶
Package kzap provides a plug-in kgo.Logger wrapping uber's zap for usage in a kgo.Client.
This can be used like so:
cl, err := kgo.NewClient( kgo.WithLogger(kzap.New(zapLogger)), // ...other opts )
By default, the logger chooses the highest level possible that is enabled on the zap logger, and then sticks with that level forever. A variable level can be chosen by specifying the LevelFn option. See the documentation on Level or LevelFn for more info.
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 provides the kgo.Logger interface for usage in kgo.WithLogger when initializing a client.
type Opt ¶
type Opt interface {
// contains filtered or unexported methods
}
Opt applies options to the logger.
func AtomicLevel ¶
func AtomicLevel(level zap.AtomicLevel) Opt
AtomicLevel returns an option that uses the current atomic level for LevelFn. If your zap logger uses the AtomicLevel already, using this option is not necessary, but it is *slightly* less work than the default level function that has to check if each level is enabled individually.