Expand description
A tracing_subscriber::Layer that pretty-prints span chains to stdout
and (optionally) the systemd journal.
§Quick start
use tracing::info;
use tracing_subscriber::prelude::*;
use tracing_systemd::SystemdLayer;
tracing_subscriber::registry()
.with(SystemdLayer::stdout().with_target(true).with_thread_ids(true))
.init();
info!("hello");§Features
| Feature | Default | Effect |
|---|---|---|
colors | yes | Enables ANSI color output via nu-ansi-term. |
journald | no | Re-exports the official tracing-journald layer through journald. Pure-Rust; no libsystemd-dev build dependency. |
json | no | Adds SystemdLayer::json for one JSON object per event (uses serde_json). |
§Migrating from 0.1
See the README for a method-by-method mapping.
Modules§
- journald
Unix and journald - Optional journald layer: a thin convenience wrapper around the official
tracing-journaldcrate.
Structs§
- Color
Theme colors - Per-element ANSI styles applied to formatted output.
- Output
- Where a layer writes formatted lines.
- Systemd
Layer - A
tracing-subscriberLayer that emits a pretty span-chain line per event.
Enums§
- Color
Mode colors - When to emit ANSI color escapes on stdout output.
- Timestamp
Format - How (or whether) to render a timestamp at the start of each stdout line.