tiny-tracing 0.4.0

Simple rusty log library (tracing-subscriber wrapper)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Logging to stderr so stdout stays free for program output.
//!
//! Run with: `cargo run --example stderr`
//! Try:      `cargo run --example stderr 2>/dev/null` (only the data is printed)

use tiny_tracing::{Logger, Output, info};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let _guard = Logger::new().with_output(Output::Stderr).init()?;

    info!("this log line goes to stderr");
    println!("this is program output, on stdout");

    Ok(())
}