Expand description
Consistent tracing shape for Santh CLI tools.
§Quick start
use santh_tracing::{init, LogLevel};
let _guard = init("mytool", LogLevel::Info);
santh_tracing::tracing::info!("ready");§Safe-defaults answers
- Input size: log-line size tracks what the caller emits; the optional
RedactingWriterbuffers one line at a time, never the whole stream. - Recursion depth: operation spans nest only as deep as the caller’s
with_opcalls; the library itself adds no recursion. - Outbound network: none. The crate performs no network access.
- Process spawning: none. The crate spawns no child processes.
- Filesystem writes: none by default (logs go to stderr). A file is opened
for append only when the caller explicitly sets
InitConfig::file_sink, which validates the path up front. - Credential exposure: the default sink does not redact. Wrap a sink in
RedactingWriterto mask secrets line-by-line throughsanth-error’s redactor before they reach the destination.
Re-exports§
pub use metrics::*;
Modules§
- metrics
- Metrics facade that automatically namespaces under
santh_<tool_name>_. - tracing
- Re-export for tool code and tests.
Macros§
- santh_
span - Run
bodyinside a span with explicit tool, operation, and target fields.
Structs§
- Init
Config - Declarative configuration for
init_with. - Init
Guard - Guard returned by
init; dropping does not uninstall the global subscriber. - Redacting
Writer - Wraps a writer and redacts known secret shapes from every line written
through it. Redaction is line-oriented: complete lines are redacted and
forwarded immediately; a trailing partial line is held until the next
newline or until
flush.
Enums§
Functions§
- init
- Install the global Santh tracing subscriber for a tool process.
- init_
with - Install the global Santh tracing subscriber from an
InitConfig. - with_op
- Run
bodyinside a nested operation span.