Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LevelLogger ¶
type LevelLogger interface { // Debug handles logging the given message at the debug level. Debug(msg string, args ...any) // Info handles logging the given message at the info level. Info(msg string, args ...any) // Warn handles logging the given message at the warn level. Warn(msg string, args ...any) // Error handles logging the given message at the error level. Error(msg string, args ...any) // WithGroup creates a new child/group Logger from the current logger. WithGroup(group string) LevelLogger // Verbose returns true if the logger is in verbose mode. Verbose() bool }
LevelLogger is a logger that supports different levels of logging.
type Logger ¶
type Logger struct { // Level is the log Level to use for // filtering log verbosity. Level slog.Level // Slogger is the underlying slog.Logger // that is used for logging. Slogger *slog.Logger // contains filtered or unexported fields }
Logger is a wrapper around slog.Logger.
func (*Logger) Debug ¶
Debug handles proxying the given message to the underlying slog.Logger at the debug level.
func (*Logger) Error ¶
Error handles proxying the given message to the underlying slog.Logger at the error level.
func (*Logger) Info ¶
Info handles proxying the given message to the underlying slog.Logger at the info level.
func (*Logger) Warn ¶
Warn handles proxying the given message to the underlying slog.Logger at the warn level.
func (*Logger) WithGroup ¶
func (l *Logger) WithGroup(group string) LevelLogger
WithGroup creates a new child/group Logger from the current logger.
type NoopLogger ¶
type NoopLogger struct{}
NoopLogger is a logger that does nothing.
func (*NoopLogger) Debug ¶
func (l *NoopLogger) Debug(msg string, args ...any)
Debug handles logging the given message at the debug level.
func (*NoopLogger) Error ¶
func (l *NoopLogger) Error(msg string, args ...any)
Error handles logging the given message at the error level.
func (*NoopLogger) Info ¶
func (l *NoopLogger) Info(msg string, args ...any)
Info handles logging the given message at the info level.
func (*NoopLogger) Verbose ¶
func (l *NoopLogger) Verbose() bool
Verbose returns true if the logger is in verbose mode.
func (*NoopLogger) Warn ¶
func (l *NoopLogger) Warn(msg string, args ...any)
Warn handles logging the given message at the warn level.
func (*NoopLogger) WithGroup ¶
func (l *NoopLogger) WithGroup(group string) LevelLogger
WithGroup creates a new child/group Logger from the current logger.