use log_easy::{
LogLevel, Logger, debug, error, info, trace, try_debug, try_error, try_info, try_trace,
try_warn, warn,
};
use std::io::Result;
fn main() -> Result<()> {
log_easy::init_with(Logger::new("target/global.log").with_level(LogLevel::Trace))?;
trace!("This is a trace message");
debug!("Debugging information here");
info!("Application started");
warn!("This is a warning");
error!("An error occurred");
try_trace!("This is a trace message using the try macro")?;
try_debug!("This is a debug message using the try macro")?;
try_info!("This is an info message using the try macro")?;
try_warn!("This is a warning message using the try macro")?;
try_error!("This is an error message using the try macro")?;
let user = "joe";
let attempts = 3;
let elapsed_ms = 127;
info!("User {user} has attempted login {attempts} times ({elapsed_ms}ms elapsed)");
Ok(())
}