Documentation
¶
Overview ¶
Package log provides leveled logging matching Microsoft LogLevel semantics.
Levels (ascending severity):
Trace (0) — most verbose, diagnostic detail Debug (1) — debugging info Info (2) — general operational messages Warn (3) — non-critical issues Error (4) — runtime errors Fatal (5) — critical failures, process exiting Off (6) — nothing logged
Index ¶
- Variables
- func Debugf(format string, args ...any)
- func Errorf(format string, args ...any)
- func Fatalf(format string, args ...any)
- func Infof(format string, args ...any)
- func Tracef(format string, args ...any)
- func Warnf(format string, args ...any)
- type Level
- type Logger
- func (l *Logger) Debug(format string, args ...any)
- func (l *Logger) Error(format string, args ...any)
- func (l *Logger) Fatal(format string, args ...any)
- func (l *Logger) Info(format string, args ...any)
- func (l *Logger) Level() Level
- func (l *Logger) SetLevel(level Level)
- func (l *Logger) Trace(format string, args ...any)
- func (l *Logger) Warn(format string, args ...any)
Constants ¶
This section is empty.
Variables ¶
View Source
var Default = New(os.Stderr, Info)
Default logger at Info level writing to stderr.
Functions ¶
Types ¶
type Level ¶
type Level int
Level is a logging severity level.
func ParseLevel ¶
ParseLevel converts a string to Level. Accepts: trace, debug, info, warn, error, fatal, off (case-insensitive).
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a leveled logger.
Click to show internal directories.
Click to hide internal directories.