Documentation
¶
Overview ¶
Package logging provides structured logging with file rotation for nightshift. Supports JSON and text formats with date-based log file naming.
Index ¶
- func Debug(msg string)
- func Error(msg string)
- func Info(msg string)
- func Init(cfg Config) error
- func Warn(msg string)
- type Config
- type Logger
- func (l *Logger) Close() error
- func (l *Logger) Debug(msg string)
- func (l *Logger) DebugCtx(msg string, fields map[string]any)
- func (l *Logger) Debugf(format string, args ...any)
- func (l *Logger) Err(err error) *zerolog.Event
- func (l *Logger) Error(msg string)
- func (l *Logger) ErrorCtx(msg string, fields map[string]any)
- func (l *Logger) Errorf(format string, args ...any)
- func (l *Logger) Event(level string) *zerolog.Event
- func (l *Logger) Info(msg string)
- func (l *Logger) InfoCtx(msg string, fields map[string]any)
- func (l *Logger) Infof(format string, args ...any)
- func (l *Logger) LogFiles() ([]string, error)
- func (l *Logger) Warn(msg string)
- func (l *Logger) WarnCtx(msg string, fields map[string]any)
- func (l *Logger) Warnf(format string, args ...any)
- func (l *Logger) With() zerolog.Context
- func (l *Logger) WithComponent(component string) *Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Level string // debug, info, warn, error
Path string // Log directory path
Format string // json, text
RetentionDays int // Days to keep logs (default 7)
}
Config holds logging configuration.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns default logging configuration.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger wraps zerolog with nightshift-specific functionality.
func (*Logger) WithComponent ¶
WithComponent returns a new Logger with the component field set.
Click to show internal directories.
Click to hide internal directories.