Documentation
¶
Index ¶
Constants ¶
const KeyDispatch = "dispatch"
KeyDispatch marks a record as an orchestrator's batch header — the "child (N/M)" line it emits as it hands work to a child. The executor sets it on every dispatch header. The pretty handler uses it to mark a nested hand-off (depth > 1) with a "▸ parent › child" form, so a deep batch header reads as a dispatch by its parent rather than masquerading as an ordinary leaf line; the run's root (depth 1) keeps its "≡ … ≡" chip.
const KeyModule = "module"
KeyModule is the attribute carrying the executing module's name (set via Logger.With in module.Load, or the per-instance name in the executor). The pretty handler renders it as a colored "[name]" prefix instead of a trailing key=value pair, so interleaved output from different modules stays separable.
const KeyRoot = "root"
KeyRoot marks a logger as the run's root/orchestrator — a module that fans work out to child modules. The executor sets it (Logger.With(KeyRoot, true)) on any module that has children, so the top-level module's own lines render with the reserved "≡ … ≡" chip. It is a structural signal, not inferred from log order, so it holds even for the very first line an orchestrator emits and for a pure orchestrator that never runs operations of its own. Children inherit the attr but stay plain: root marking is gated on module depth == 1.
const KeySection = "section"
KeySection marks a log record as a section header. The pretty handler renders it with a leading blank line and bold text; structured handlers keep it as a regular attribute.
Variables ¶
This section is empty.
Functions ¶
func Failuref ¶ added in v0.3.0
Failuref writes a "✖"-prefixed error line to w, colored red when w is a terminal. Used for the top-level command error, which is returned up to main and so never flows through the log handler.
Types ¶
type PrettyHandler ¶
type PrettyHandler struct {
// contains filtered or unexported fields
}
PrettyHandler formats log output for human readability.
func NewPrettyHandler ¶
func NewPrettyHandler(w io.Writer, opts *slog.HandlerOptions) *PrettyHandler
NewPrettyHandler creates a human-friendly log handler.