Documentation
¶
Overview ¶
Package zap implements the logger.Logger interface using uber/zap implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*config) error
Option defines a function signature to update configuration.
func WithConfig ¶
WithConfig takes the logger configuration and applies it.
func WithConsoleFormatter ¶
WithConsoleFormatter configures the format of the log output
to use "console" (cli) formatter.
func WithJSONFormatter ¶
func WithJSONFormatter() Option
WithJSONFormatter configures the format of the log output
to use "json" formatter.
func WithLevel ¶
WithLevel configures the minimum level of the logger. It can late be updated with SetLevel.
func WithOutputPaths ¶
WithOutputPaths configures the paths used to write logs to.
To use standart output, and error output, use stdout or stderr.
func WithZapConfig ¶
WithZapConfig applies zap configuration directly into the configuration.
func WithoutTime ¶ added in v1.2.0
func WithoutTime() Option
WithoutTime configures the logger to log without time.
type Zap ¶
type Zap struct { *zap.SugaredLogger // contains filtered or unexported fields }
Zap implements Logger interface.
Click to show internal directories.
Click to hide internal directories.