Documentation
¶
Index ¶
Constants ¶
View Source
const ( LevelDebug = slog.LevelDebug LevelInfo = slog.LevelInfo LevelWarn = slog.LevelWarn LevelError = slog.LevelError )
Log levels.
Variables ¶
View Source
var ( String = slog.String Int = slog.Int Int64 = slog.Int64 Uint64 = slog.Uint64 Float64 = slog.Float64 Bool = slog.Bool Time = slog.Time Duration = slog.Duration Group = slog.Group Any = slog.Any )
Re-export slog attribute constructors so callers don't need to import log/slog
Functions ¶
Types ¶
type Logger ¶
type Logger interface {
Debug(msg string, args ...any)
Info(msg string, args ...any)
Warn(msg string, args ...any)
Error(msg string, args ...any)
With(args ...any) Logger
}
Logger is the interface for logging throughout the application
type Scope ¶
type Scope struct {
// contains filtered or unexported fields
}
Scope wraps a Logger with hierarchical path tracking. Pass scopes down through component constructors to build a hierarchy of nested components. Unlike OpenTelemetry spans, scopes are long-lived (component lifetime) not per-operation.
func RootScope ¶
RootScope creates a root scope from a logger. It has no name until Child is called.
Click to show internal directories.
Click to hide internal directories.