Documentation
¶
Overview ¶
Package logging is the one place log handlers are built. It turns the checked-in LoggingConfig into a *slog.Logger (JSON for machines, text for consoles, optional rotating file sink) and is exported so consumers embedding the kernel (goblin) reuse the same wiring instead of growing their own. Call sites log through slog with typed attribute constructors (see internal/logattr); this package only builds handlers.
Index ¶
Constants ¶
const ( KmsgErr = 3 KmsgWarn = 4 KmsgInfo = 6 )
kmsg priorities (syslog levels used by /dev/kmsg).
Variables ¶
This section is empty.
Functions ¶
func Build ¶
Build constructs the process logger from configuration: a JSON handler by default, a text handler for `format: console`, writing to stdout plus an optional rotating file sink. The returned Closer shuts the file sink; callers close it on shutdown.
func ParseLevel ¶
ParseLevel maps the config-file level names onto slog levels. "trace" (a zerolog-era name kept for config compatibility) maps to debug; unknown names default to info.
Types ¶
type Kmsg ¶
type Kmsg struct {
// contains filtered or unexported fields
}
Kmsg is the Phase-0 progressive logger (GAPI-DIV-027): before the event bus and structured logging exist, boot narrates directly to /dev/kmsg. The path is injectable for tests; writes are best-effort by design - the logger must never be able to fail the boot it is narrating.