How to Use the tracing Crate in Rust

Add the tracing crate to Cargo.toml and initialize a subscriber to enable structured logging and diagnostics in Rust.

Add the tracing crate to your dependencies and initialize a subscriber in your main function to capture events.

[dependencies]
tracing = "0.1"
tracing-subscriber = "0.3"
use tracing::{info, Level};
use tracing_subscriber;

fn main() {
    tracing_subscriber::fmt()
        .with_max_level(Level::INFO)
        .init();
    
    info!("Application started");
}