Documentation
¶
Index ¶
- type Config
- type Logger
- func (l *Logger) Debug(msg string, fields ...zap.Field)
- func (l *Logger) Error(msg string, fields ...zap.Field)
- func (l *Logger) Fatal(msg string, fields ...zap.Field)
- func (l *Logger) Info(msg string, fields ...zap.Field)
- func (l *Logger) LogHTTPRequest(method, path, traceID string, statusCode int, durationMs float64)
- func (l *Logger) LogTrace(spanName, traceID string, durationMs float64)
- func (l *Logger) Sync()
- func (l *Logger) UpdateConfig(cfg Config)
- func (l *Logger) Warn(msg string, fields ...zap.Field)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Level string // Log level: debug, info, warn, error
Environment string // Environment: production, development
}
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig provides a baseline configuration for the logger.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func GetLogger ¶
func GetLogger() *Logger
GetLogger initializes or returns the singleton logger instance.
func (*Logger) LogHTTPRequest ¶
LogHTTPRequest logs details of an HTTP request.
func (*Logger) UpdateConfig ¶
UpdateConfig allows dynamic reconfiguration of the logger.
Click to show internal directories.
Click to hide internal directories.