Expand description
Runtime log-level gate for the log_* macros.
Levels, low → high: TRACE < DEBUG < INFO < WARN < ERROR < OFF. A message at
level L prints iff L >= threshold. Default is WARN (warnings + errors),
overridable at launch via VECTOR_LOG=trace|debug|info|warn|error|off or at
runtime via set_log_level. log_info!/log_debug!/log_trace! remain
compiled out entirely in release; the gate only narrows the dev firehose.
Constants§
Functions§
- format_
unix_ utc - Civil date from unix seconds (Howard Hinnant’s
civil_from_days). - level_
enabled - Whether a message at
levelshould print under the active threshold. - log_
level - Active threshold, initialising from
VECTOR_LOGon first read (benign race: concurrent initialisers all compute the same value). - persist
- Route a pre-formatted line to the persistent log, if a sink is registered.
- set_
log_ level - Override the threshold at runtime (e.g. a settings toggle).
- set_
log_ level_ str - Set the threshold by name (
trace|debug|info|warn|error|off); returns false on an unknown name. - set_
persist_ sink - Register the shell’s persistent-log writer. First registration wins.
- timestamp_
utc YYYY-MM-DD HH:MM:SSZfor the current instant, dependency-free (no chrono in the tree). A bare clock time can’t tell a support-log reader whether an error predates a fix — the date is the whole point of a persistent log.