Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidLogLevel ¶
func NewLogger ¶
func NewLogger(cfg *LoggingConfig) *zap.Logger
NewLogger initializes a zap.Logger instance if it has not been initialized already and returns the same instance for subsequent calls.
func SetLogLevel ¶
SetLogLevel dynamically updates the log level at runtime
Types ¶
type LoggingConfig ¶
type LoggingConfig struct { Level string `mapstructure:"level"` FilePath string `mapstructure:"file_path"` MaxSize int `mapstructure:"max_size"` MaxBackups int `mapstructure:"max_backups"` MaxAge int `mapstructure:"max_age"` Compress bool `mapstructure:"compress"` DebugMode bool `mapstructure:"debug_mode"` AddTime bool `mapstructure:"add_time"` }
func NewLoggingConfig ¶
func NewLoggingConfig(level, filePath string, maxSize, maxBackups, maxAge int, compress, debugMode, addTime bool) *LoggingConfig
NewLoggingConfig creates a new logging configuration.
Click to show internal directories.
Click to hide internal directories.