Documentation
¶
Index ¶
- func Debug(msg string, args ...interface{})
- func Debugf(template string, args ...interface{})
- func Error(msg string, args ...interface{})
- func Errorf(template string, args ...interface{})
- func Fatal(msg string, args ...interface{})
- func Fatalf(template string, args ...interface{})
- func Get() *zap.SugaredLogger
- func Info(msg string, args ...interface{})
- func Infof(template string, args ...interface{})
- func Init(cfg Config) error
- func Progress(msg string, args ...interface{})
- func Progressf(template string, args ...interface{})
- func Reset()
- func Sync() error
- func Warn(msg string, args ...interface{})
- func Warnf(template string, args ...interface{})
- func With(args ...interface{}) *zap.SugaredLogger
- type Config
- type LogLevel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(template string, args ...interface{})
Debugf logs a formatted debug message
func Errorf ¶
func Errorf(template string, args ...interface{})
Errorf logs a formatted error message
func Fatalf ¶
func Fatalf(template string, args ...interface{})
Fatalf logs a formatted fatal message and exits
func Get ¶
func Get() *zap.SugaredLogger
Get returns the global logger If not initialized, it initializes with default config
func Progress ¶
func Progress(msg string, args ...interface{})
Progress logs a progress message (maps to Info level)
func Progressf ¶
func Progressf(template string, args ...interface{})
Progressf logs a formatted progress message
func Warnf ¶
func Warnf(template string, args ...interface{})
Warnf logs a formatted warning message
func With ¶
func With(args ...interface{}) *zap.SugaredLogger
With returns a logger with additional fields
Types ¶
type Config ¶
Config holds logger configuration
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default logger configuration
type LogLevel ¶
type LogLevel string
LogLevel represents the verbosity of logging
const ( // LevelDebug enables all logs LevelDebug LogLevel = "debug" // LevelInfo enables info, warning, and error logs LevelInfo LogLevel = "info" // LevelProgress enables progress, warning, and error logs (default) LevelProgress LogLevel = "progress" // LevelMinimal enables only warning and error logs LevelMinimal LogLevel = "minimal" // LevelWarn enables only warning and error logs (alias for minimal) LevelWarn LogLevel = "warn" // LevelError enables only error logs LevelError LogLevel = "error" )
Click to show internal directories.
Click to hide internal directories.