Home
Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Pretty Print Rust tracing Log Output

rust
```cargo
[dependencies]
tracing = "0.1"
tracing-subscriber = "0.3"
```

use tracing::{Level, event, instrument};

#[instrument]
fn main() {
    let format = tracing_subscriber::fmt::format().pretty();
    tracing_subscriber::fmt()
      .event_format(format)
      .with_ansi(false)
      .with_max_level(Level::DEBUG)
      .init();
  event!(Level::INFO, "This is an info message");
  event!(Level::DEBUG, "This is a debug message");
}
results start

This is how I'm pretty printing multi - line log messages in Rust with the tracing and tracing-subscriber crates

Footnotes And References