Skip to main content

Module log

Module log 

Source
Expand description

Runtime logging — errlog severity surface plus the rt_* macros.

C parity: modules/libcom/src/error/errlog.{c,h}.

The four rt_* macros route through the tracing facade (the crate’s de-facto logging path) instead of bare eprintln!, so an application’s tracing subscriber controls level filtering, formatting, and sinks uniformly.

The errlog-severity API mirrors errlogSevEnum, errlogSevEnumString, errlogSetSevToLog/errlogGetSevToLog, and errlogSevPrintf — a record’s error messages can be suppressed below a configurable severity threshold, exactly as a C IOC does.

Enums§

ErrlogSevEnum
Error-message severity — C errlogSevEnum (errlog.h:49-53).

Functions§

erl_warning
C ERL_WARNING (errlog.h:299) — the word an errlog warning line carries, magenta on a terminal console and plain everywhere else.
errlog_get_sev_to_log
Get the current severity-to-log threshold — C errlogGetSevToLog (errlog.c:407-415).
errlog_printf
Emit a pre-formatted message through the errlog facility unconditionally — C errlogVprintf/errlogPrintf (errlog.c:333-364), the no-severity variant.
errlog_set_sev_to_log
Set the severity-to-log threshold — C errlogSetSevToLog (errlog.c:399-405). Messages with a severity below this value are suppressed.
errlog_sev_enum_string
String representation of an errlog severity.
errlog_sev_printf
Emit a pre-formatted error message at the given severity, suppressed when severity is below the errlog_get_sev_to_log threshold.
install_console_subscriber
Make this process’s diagnostics reach the console, if nothing else has.
install_panic_hook
Route panics through errlog, in addition to whatever std already does.
single_line
Render record so it cannot end or split a line in a line-oriented log.