Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidLevel = errors.New("invalid log level")
ErrInvalidLevel indicates a Config.Level value log/slog does not recognize.
Functions ¶
func New ¶
New returns a logger that writes JSON records at cfg.Level, and a Closer for the underlying file. Disabled is the default and costs nothing: with Level == "" the logger discards everything and the Closer is a no-op, so no file is created, opened, or read - this is what keeps a disabled log from ever growing. A non-empty Level truncates an oversized log to its tail before opening it for append.
Types ¶
Click to show internal directories.
Click to hide internal directories.