Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Level specifies the minimum log level to output (debug, info, warn, error).
Level string `yaml:"level"`
// Encoding specifies the output format (json or console).
Encoding string `yaml:"encoding"`
// OutputPath specifies the path to the log file. If empty, logs are written to stdout.
OutputPath string `yaml:"outputPath"`
}
Config holds the configuration for the logger. It allows customization of log level, output format, and destination.
func DefaultLoggerConfig ¶
func DefaultLoggerConfig() *Config
defaultLoggerConfig returns a new Config with default settings. The log level is determined by the LOG_LEVEL environment variable, defaulting to "error" if not set. The encoding defaults to "console".
Click to show internal directories.
Click to hide internal directories.