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.

Write An Hourly Log File With Rust

This creates a logger and writes out an hourly file. There's a lot of other options for this and some of the options aren't being used yet. (This page is still a work in progress), but this works

use tracing::{debug, error, info, span, warn, Level};

fn main() {
    let file_appender = tracing_appender::rolling::hourly("/Users/alan/Desktop", "prefix.log");
    let (non_blocking, _guard) = tracing_appender::non_blocking(file_appender);
    tracing_subscriber::fmt().with_writer(non_blocking).init();
    info!["this is info"];
    println!("Hello, world!");
    alfa("yo");
}

#[tracing::instrument]
fn alfa(ping: &str) {
    info!["here"];
    println!("{}", ping);
}

Needs :