Documentation
¶
Overview ¶
Package slogutil provides configuration and setup utilities for slog.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidFormat = errors.New("invalid log format")
ErrInvalidFormat is returned when Format contains an unrecognized value.
View Source
var ErrInvalidLevel = errors.New("invalid log level")
ErrInvalidLevel is returned when Level contains an unrecognized value.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Level is the minimum log level.
// Valid values: "debug", "info", "warn", "warning", "error".
// Default: "info"
Level string `koanf:"level"`
// Format is the output format.
// Valid values: "text", "json".
// Default: "text"
Format string `koanf:"format"`
}
Config holds configuration for slog setup.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a Config with sensible defaults.
Click to show internal directories.
Click to hide internal directories.