Documentation
¶
Overview ¶
Package logging provides a structured logging system based on zap. It supports configurable log levels and output formats (JSON/text).
Index ¶
- func Any(key string, value interface{}) zap.Field
- func Debug(msg string, fields ...zap.Field)
- func Debugf(template string, args ...interface{})
- func Duration(key string, value interface{}) zap.Field
- func Err(err error) zap.Field
- func Error(msg string, fields ...zap.Field)
- func Errorf(template string, args ...interface{})
- func Fatal(msg string, fields ...zap.Field)
- func Fatalf(template string, args ...interface{})
- func Info(msg string, fields ...zap.Field)
- func Infof(template string, args ...interface{})
- func Init(cfg *Config) error
- func Int(key string, value int) zap.Field
- func Int64(key string, value int64) zap.Field
- func L() *zap.Logger
- func S() *zap.SugaredLogger
- func String(key, value string) zap.Field
- func Sync() error
- func Warn(msg string, fields ...zap.Field)
- func Warnf(template string, args ...interface{})
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(template string, args ...interface{})
Debugf logs a formatted message at DebugLevel.
func Errorf ¶
func Errorf(template string, args ...interface{})
Errorf logs a formatted message at ErrorLevel.
func Fatalf ¶
func Fatalf(template string, args ...interface{})
Fatalf logs a formatted message at FatalLevel, then calls os.Exit(1).
func Infof ¶
func Infof(template string, args ...interface{})
Infof logs a formatted message at InfoLevel.
func Init ¶
Init initializes the logging system with the given configuration. It should be called early in the application startup.
func Sync ¶
func Sync() error
Sync flushes any buffered log entries. Should be called before the application exits.
Types ¶
Click to show internal directories.
Click to hide internal directories.