Crate tracing_logfmt

source ·
Expand description

Formatter for logging tracing_subscriber events in logfmt format.

Use as a formatting layer in tracing subscriber:

use tracing::dispatcher::{self, Dispatch};
use tracing_subscriber::Registry;
use tracing_subscriber::layer::SubscriberExt;

let subscriber = Registry::default()
    .with(tracing_logfmt::layer());

dispatcher::set_global_default(Dispatch::new(subscriber))
    .expect("Global logger has already been set!");

Structs§

Functions§

  • Create a builder that can be used to configure the formatter.
  • Creates a formatting layer