Documentation
¶
Overview ¶
Package logging provides the default Zap-based implementation of the log.Logger interface. This module can be replaced with custom logging implementations while maintaining compatibility with the framework and other modules.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Module("logging", fx.Provide( NewZapLoggerAdapter, fx.Annotate( func(adapter *zapLoggerAdapter) log.Logger { return adapter }, fx.As(new(log.Logger)), ), ), )
Module provides the default Zap-based implementation of the log.Logger interface.
Functions ¶
func NewZapLoggerAdapter ¶
NewZapLoggerAdapter creates a new Zap-based logger adapter.
Types ¶
type Config ¶
type Config struct {
Level string `mapstructure:"level"` // Log level: debug, info, warn, error
Encoding string `mapstructure:"encoding"` // Output format: json or console
OutputPath string `mapstructure:"output_path"` // Output path: stdout, stderr, or file path
}
Config holds the logging configuration.
Click to show internal directories.
Click to hide internal directories.