unilog

Crates.iounilog
lib.rsunilog
version0.1.3
created_at2025-02-17 12:31:40.850278+00
updated_at2025-02-17 12:31:40.850278+00
descriptionA lightweight Rust logging library supporting async/sync logging and colored logs.
homepagehttps://github.com/Axnjr/unilog_rs
repositoryhttps://github.com/Axnjr/unilog_rs
max_upload_size
id1558868
size25,571
Yakshit (Axnjr)

documentation

https://docs.rs/unilog

README

🦀unilog.rs

Example

use unilog::{Level, UniLog, Fatal, Error, Warn, Notice, Info, Debug, Trace};

fn main() {
    let instance = UniLog::init()
        .set_log_file_name("server.log") // dont forget the file extension
        .log_to_terminal(true)
        .async_logging()
        .enable_timestamping()
        .enable_colored_logs()
        .max_log_file_size(20) // 20 Mb, would truncate the log file if its size exceeds this limit!
    ;

    Fatal! (instance, "TRIAL of fatal error via macros !!");
    Notice!(instance, "TRIAL of notices lets see what happens !!");
    Warn!  (instance, "TRIAL of warnings lets see what happens !!");
    Info!  (instance, "TRIAL of information lets see what happens !!");
    Debug! (instance, "TRIAL of debugging lets see what happens !!");
    Error! (instance, "TRIAL of error lets see what happens !!");
    Trace! (instance, "TRIAL of tracing lets see what happens !!");
}
Commit count: 14

cargo fmt