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 ¶
Parses a string representation of a log level (TRACE, DEBUG, INFO, WARN, ERROR, FATAL) into a Level value, returning an error for invalid inputs.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func NewJson ¶
Constructs a Logger that writes JSON-formatted logs to the provided io.Writer, with the underlying handler configured for Trace-level logging and custom attribute replacement, while the Logger's active level is set to Info.
func NewText ¶
Constructs a Logger that writes text-formatted log entries to the specified io.Writer, configured for trace-level logging with custom attribute handling.
Click to show internal directories.
Click to hide internal directories.