Documentation
¶
Overview ¶
Package log is used to initialize the logger.
Index ¶
Constants ¶
View Source
const LevelTrace = slog.Level(-8)
LevelTrace represents the Trace log level.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockLog ¶
type MockLog struct{}
MockLog is a mock implementation of the T interface for testing purposes. It implements all the methods of the T interface but does not perform any actual logging.
type Slogger ¶
type Slogger struct {
// contains filtered or unexported fields
}
Slogger wraps a slog.Logger.
func NewSlogger ¶
NewSlogger creates a new Slogger instance with the provided slog.Logger.
type T ¶
type T interface {
// Trace logs a message at Trace level.
Trace(msg string, args ...any)
// Debug logs a message at Debug level.
Debug(msg string, args ...any)
// Info logs a message at Info level.
Info(msg string, args ...any)
// Warn logs a message at Warn level.
Warn(msg string, args ...any)
// Error logs a message at Error level.
Error(msg string, args ...any)
// With creates a new logger with additional context.
With(args ...any) T
}
T represents structs capable of logging messages.
Click to show internal directories.
Click to hide internal directories.