log4rc 0.4.0

A log4j-like logging framework for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use log4rc::{LogLevel, Logger};

fn main() {
    // Initialize the logger with Debug level
    Logger::init(LogLevel::Debug);
    
    // Test all log levels
    log4rc::trace!("This is a trace message - won't be printed");
    log4rc::debug!("This is a debug message - will be printed");
    log4rc::info!("This is an info message - will be printed");
    log4rc::warn!("This is a warning message - will be printed");
    log4rc::error!("This is an error message - will be printed");
    
    println!("\n--- Setting log level to Trace ---");
    // Reconfigure the logger with a new log level
    Logger::init(LogLevel::Trace);
    log4rc::trace!("This is a trace message - now will be printed");
}