Documentation
¶
Index ¶
- func Debug(t Tag, msg string, v ...any)
- func Error(t Tag, msg string, v ...any)
- func Fatal(t Tag, msg string, v ...any)
- func Info(t Tag, msg string, v ...any)
- func Trace(t Tag, msg string, v ...any)
- func Warn(t Tag, msg string, v ...any)
- type Level
- type Logger
- func (l *Logger) Debug(t Tag, msg string, v ...any)
- func (l *Logger) Error(t Tag, msg string, v ...any)
- func (l *Logger) Fatal(t Tag, msg string, v ...any)
- func (l *Logger) Info(t Tag, msg string, v ...any)
- func (l *Logger) Level() Level
- func (l *Logger) SetLevel(level Level) (prev Level)
- func (l *Logger) Trace(t Tag, msg string, v ...any)
- func (l *Logger) Warn(t Tag, msg string, v ...any)
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Level ¶
type Level int
const LevelDebug Level = -4
const LevelError Level = 8
const LevelFatal Level = 12
const LevelInfo Level = 0
const LevelTrace Level = -8
const LevelWarn Level = 4
func ParseLevel ¶
(AI GENERATED DESCRIPTION): Parses a log level string (e.g., "DEBUG") into its corresponding `Level` value, returning an error if the string is not a recognized level.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func NewJson ¶ added in v1.4.3
(AI GENERATED DESCRIPTION): Creates a Logger that writes JSON‑formatted log entries to the supplied `io.Writer`, initializing the underlying slog handler at trace level while setting the Logger’s default level to info.
func NewText ¶
(AI GENERATED DESCRIPTION): Creates a new `Logger` that writes text‑formatted log entries to the supplied `io.Writer`, using a trace‑level text handler and initializing the logger’s current level to `Info`.
Click to show internal directories.
Click to hide internal directories.