Skip to main content

Crate tracing_systemd

Crate tracing_systemd 

Source
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

FeatureDefaultEffect
colorsyesEnables ANSI color output via nu-ansi-term.
journaldnoRe-exports the official tracing-journald layer through journald. Pure-Rust; no libsystemd-dev build dependency.
jsonnoAdds 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§

journaldUnix and journald
Optional journald layer: a thin convenience wrapper around the official tracing-journald crate.

Structs§

ColorThemecolors
Per-element ANSI styles applied to formatted output.
Output
Where a layer writes formatted lines.
SystemdLayer
A tracing-subscriber Layer that emits a pretty span-chain line per event.

Enums§

ColorModecolors
When to emit ANSI color escapes on stdout output.
TimestampFormat
How (or whether) to render a timestamp at the start of each stdout line.