Documentation ¶
Index ¶
- func NewZapConsoleLogger(w io.Writer, level zapcore.Level, opts ...zap.Option) *zap.Logger
- func NewZapJSONLogger(w io.Writer, level zapcore.Level, opts ...zap.Option) *zap.Logger
- func NewZapLogger(enc zapcore.Encoder, w io.Writer, level zapcore.Level, opts ...zap.Option) *zap.Logger
- func NewZapTestingLogger(w io.Writer, level zapcore.Level, opts ...zap.Option) *zap.Logger
- func ZapLoggerToSlog(logger *zap.Logger) *slog.Logger
- type Format
- type NewZapLoggerFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewZapConsoleLogger ¶
NewZapConsoleLogger creates a zap logger with a console encoder for development use.
func NewZapJSONLogger ¶
NewZapJSONLogger creates a zap logger with a JSON encoder for production use.
func NewZapLogger ¶
func NewZapLogger(enc zapcore.Encoder, w io.Writer, level zapcore.Level, opts ...zap.Option) *zap.Logger
NewZapLogger creates a new zap logger instance, for the given level, writer and zap encoder.
func NewZapTestingLogger ¶
NewZapTestingLogger creates a zap logger with a console encoder optimized for testing.
Types ¶
type NewZapLoggerFn ¶
NewZapLoggerFn is the zap logger init declaration
func GetZapLoggerFn ¶
func GetZapLoggerFn(format Format) NewZapLoggerFn
GetZapLoggerFn returns the appropriate init callback for the zap logger, given the requested format
Click to show internal directories.
Click to hide internal directories.