Documentation
¶
Overview ¶
Package log provides structured logging configuration for Aether components.
Logging is built on the standard library's log/slog. Records are emitted as JSON to stderr (parsed via kubectl logs) and, when an OTLP handler is supplied, fanned out to the OpenTelemetry logs bridge as well. slog's context-aware Handle is what lets the otelslog bridge populate trace_id/span_id natively from the ctx passed to the *Context log methods.
Log levels can be controlled via the debug flag:
- debug=false: Info level (default production setting)
- debug=true: Trace level (enables the V(1)/V(2)-equivalent debug output)
Index ¶
Constants ¶
const LevelTrace slog.Level = -8
LevelTrace is the most verbose level, mapping the old logr V(2) calls. logr V(1) maps to slog.LevelDebug (-4); V(2) needs something lower.
Variables ¶
This section is empty.
Functions ¶
func Named ¶
Named returns a child logger tagged with a component name under the "logger" field, replacing logr's WithName. Naming is hierarchical and dot-joined (e.g. "aether-agent" then "cache" -> "aether-agent.cache"), and always emits a single "logger" key — unlike a plain With(loggerKey, …), which would append a second "logger" attribute on every re-name and produce duplicate JSON keys.
func NewLoggerWithHandler ¶
NewLoggerWithHandler is like NewLogger but, when extra is non-nil, fans every record out to that additional handler (the otelslog OTLP bridge) in addition to the stderr JSON sink. The extra sink inherits the same level threshold so both outputs stay consistent.
Types ¶
This section is empty.