Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface {
Info(msg string, fields ...map[string]any)
Error(msg string, err error, fields ...map[string]any)
Debug(msg string, fields ...map[string]any)
Warn(msg string, fields ...map[string]any)
}
func DefaultConsoleLogger ¶ added in v1.1.3
func DefaultConsoleLogger() Logger
func DefaultFileLogger ¶ added in v1.1.3
func DefaultNoopLogger ¶ added in v1.1.3
func DefaultNoopLogger() Logger
func DefaultZapLogger ¶ added in v1.1.3
DefaultZapLogger creates a high-performance logger using uber-go/zap with lumberjack for log rotation.
type ZapConfig ¶ added in v1.1.3
type ZapConfig struct {
// Filename is the file to write logs to.
Filename string
// MaxSize is the maximum size in megabytes of the log file before it gets rotated.
MaxSize int
// MaxBackups is the maximum number of old log files to retain.
MaxBackups int
// MaxAge is the maximum number of days to retain old log files.
MaxAge int
// Compress determines if the rotated log files should be compressed using gzip.
Compress bool
// Console specifies if logs should also be printed to standard output.
Console bool
}
ZapConfig defines the options for the Zap rolling logger
Click to show internal directories.
Click to hide internal directories.