Documentation
¶
Overview ¶
Package logger provides structured logging (slog) and context-aware logger retrieval for Genie.
It solves the problem of having a single place to configure log level, output format (JSON or text), and to attach loggers to context so that downstream code can use backend.Logger.FromContext(ctx) without passing a logger explicitly. GetLogger(ctx) returns the request-scoped logger when available, falling back to the default. Without this package, logging would be ad-hoc and inconsistent across components.
Index ¶
- func ErrorAttr(err error) slog.Attr
- func GetLogger(ctx context.Context) *slog.Logger
- func IsDebugEnabled() bool
- func LogLevel() slog.Level
- func SendJSONTo(w io.Writer)
- func SetLogHandler(handler slog.Handler)
- func SetLogLevel(newLevel slog.Level)
- func WithArgs(ctx context.Context, args ...any) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDebugEnabled ¶
func IsDebugEnabled() bool
func SendJSONTo ¶
func SetLogHandler ¶
func SetLogLevel ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.