Documentation
¶
Overview ¶
Package log provides context-aware structured logging helpers for dark-factory. It allows a *slog.Logger to be bound to a context.Context (via NewContext) and retrieved from it (via From), falling back to slog.Default() when no logger is bound.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func From ¶
From returns the *slog.Logger bound to ctx by NewContext. When no logger is bound (boot path, tests, pre-bind hot-path lines), it returns slog.Default() — never nil. Callers can therefore always call log.From(ctx).Info(...) without a nil check. The fallback emits to whatever handler slog.SetDefault installed (see main.go / pkg/runner/runner.go).
func NewContext ¶
NewContext returns a copy of ctx carrying logger. Downstream code retrieves it via From. Re-binding (e.g. after a container is assigned) is done by calling NewContext again with a logger derived via logger.With(...).
Types ¶
This section is empty.