Documentation
¶
Overview ¶
Package logging provides structured logging using slog.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Setup ¶
func Setup(level string, json bool, fc *FileConfig)
Setup initializes the global logger. Logs are always written to stdout. When fc is non-nil and fc.Path is set, logs are additionally written to a rotating file via lumberjack.
Types ¶
type FileConfig ¶
type FileConfig struct {
Path string // log file path
MaxSizeMB int // max size per file in MB
MaxBackups int // max number of old log files to keep
}
FileConfig holds log file rotation settings.