Expand description
File-based log writing for hermod-tracer
Each node gets its own subdirectory under the configured logRoot.
Within that directory, log output is written to a timestamped file:
{logRoot}/
└── {node-id}/
├── node-2024-01-15T10-30-00.json ← previous file
├── node-2024-01-15T12-00-00.json ← current file
└── node.json ← symlink → current fileThe symlink is updated atomically via a .tmp rename so readers always
see a consistent target.
Two formats are supported:
LogFormat::ForHuman—"{timestamp} [{severity}] {namespace} {message}\n"LogFormat::ForMachine— one JSON object per line (newline-delimited JSON)
Structs§
- LogHandle
- One open log file
- LogKey
- A key into the handle cache
- LogWriter
- Shared writer — holds open file handles for all active (node, logging-config) pairs
Functions§
- format_
human - Human-readable format:
{timestamp} [{severity}] {namespace} {message}\n - format_
machine - Machine-readable format: JSON line
- format_
trace - Format a single trace as a line (with trailing newline)