Skip to main content

Crate robonix_scribe

Crate robonix_scribe 

Source
Expand description

Scribe — Robonix unified logging facade.

Single entry point: log(). Every component calls the same function; Scribe routes each record to stderr (human-readable) and to a per-tag JSON-lines file under $SCRIBE_LOG_DIR (or ./logs).

§Quick start

robonix_scribe::init("executor");
robonix_scribe::info!("robonix-executor starting");
robonix_scribe::warn!("retry {}/{}", n, max);

The init() call sets a process-wide default tag used by all subsequent info! / warn! / error! / debug! macro calls. For per-message dynamic tags, use the lower-level log() function.

Modules§

format
Console formatter — logcat-style single-line human-readable output.
sink
Per-tag file sink — JSON-lines output, one file per tag.

Macros§

debug
Log at DEBUG level using the process-wide default tag set by init.
error
Log at ERROR level using the process-wide default tag set by init.
info
Log at INFO level using the process-wide default tag set by init.
warn
Log at WARN level using the process-wide default tag set by init.

Structs§

LogRecord
A single structured log record.

Enums§

Level
Severity level, ordered Debug < Info < Warn < Error.

Functions§

debug
Convenience: Level::Debug.
error
Convenience: Level::Error.
info
Convenience: Level::Info.
ingest
Ingest a captured stdout/stderr line from a child process under tag.
init
Set the process-wide default tag. Call once at startup, before any log call. All info! / warn! / error! / debug! macros use this tag after it is set.
init_from_config
Initialise scribe with the process tag and apply the on-disk log level from a launch-config JSON — the system component’s manifest config block that rbnx serialises and passes via --config-json. Reads the top-level log key (e.g. {"log":"debug"}); a valid level sets the file-sink floor for this process so the level actually reaches the log file (rbnx logs).
log
Log a record with the given level, tag, and msg.
ts_fmt
Format a nanosecond UNIX timestamp as a local-time readable string: "YYYY-MM-DD HH:MM:SS.nnnnnnnnn".
ts_parse
Parse a ts_fmt-style string back to nanosecond u64. Returns None on malformed input.
warn
Convenience: Level::Warn.