Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger interface {
Log(ctx context.Context, level slog.Level, msg string, args ...any)
Info(msg string, args ...any)
Debug(msg string, args ...any)
Warn(msg string, args ...any)
Error(msg string, args ...any)
With(args ...any) Logger
}
Logger defines the interface for structured logging.
func NewLogger ¶
func NewLogger(opts ...LoggerOption) Logger
NewLogger creates a new Logger instance with the specified options.
type LoggerOption ¶
type LoggerOption func(opts *loggerOptions)
LoggerOption configures a Logger.
func WithDevelopment ¶
func WithDevelopment() LoggerOption
WithDevelopment configures the Logger for development mode with human-readable output.
func WithLevel ¶
func WithLevel(level slog.Level) LoggerOption
WithLevel sets the logging level for the Logger.
func WithNop ¶
func WithNop() LoggerOption
WithNop configures a no-operation Logger that discards all log messages.
Click to show internal directories.
Click to hide internal directories.