Documentation
¶
Overview ¶
Package logging is the daemon's own log: leveled, timestamped lines through charmbracelet/log, in text for a person (coloured on a terminal) or json or logfmt for a collector.
The packages that log take a plain func(format string, v ...any), so they stay free of any logging library; Logf adapts a logger to that, choosing each line's level from what it says. A package that knows better can be handed a logger with WithPrefix and call its leveled methods itself.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Classify ¶
Classify guesses a line's level from its wording. The daemon's lines were written for a person, without levels, and saying something failed is how they mark trouble: an error is something that didn't happen, a warning is something that went ahead in a lesser way, and the rest is information.
func Logf ¶
Logf adapts l to the func(format, v...) the daemon's packages log through. Each line's level is read from its wording (see Classify), and the "outpost: " every line used to start with is dropped, since the logger's prefix now says where a line came from.
func New ¶
New is a logger writing to w at level ("debug", "info", "warn" or "error") in format ("text", "json" or "logfmt"). Unknown values fall back to info and text; config validation is where they are refused.
func ParseLevel ¶
ParseLevel reads a level name; anything else is info.
Types ¶
This section is empty.