use anyhow::Result;
#[tokio::main]
async fn main() -> Result<()> {
let tracer = kerf::Kerf::init(
kerf::Config::default_main()
.with_tab("main", kerf::Match::info().all_modules())
.with_tab("debug", kerf::Match::debug().all_modules()),
)?;
let log_path = tracer.set_tmpfile_callback()?;
println!("Logging to tmpfile: {}", log_path.display());
println!("This file will persist after the program exits.\n");
for i in 0..10 {
tracing::info!("Info message {}", i);
tracing::debug!("Debug message {}", i);
tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
}
println!("\nDone! Check the log file at: {}", log_path.display());
tokio::time::sleep(tokio::time::Duration::from_millis(500)).await;
Ok(())
}