unilog 0.1.3

A lightweight Rust logging library supporting async/sync logging and colored logs.
Documentation
  • Coverage
  • 54.84%
    17 out of 31 items documented0 out of 17 items with examples
  • Size
  • Source code size: 25.57 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 412.19 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 14s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Axnjr/unilog_rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Axnjr

🦀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 !!");
}