#log #cbsk #run-time #tokio #rayon #tool #callback

cbsk_log_rayon

cbsk_log_rayon is a log tool, using tokio as the runtime

3 stable releases

new 2.0.6 Nov 15, 2024
2.0.2 Sep 4, 2024
2.0.1 Aug 26, 2024

#1780 in Data structures

Download history 142/week @ 2024-08-25 148/week @ 2024-09-01 6/week @ 2024-09-08 5/week @ 2024-09-15 6/week @ 2024-09-22 5/week @ 2024-10-06 6/week @ 2024-10-13 12/week @ 2024-11-03 100/week @ 2024-11-10

112 downloads per month

MIT/Apache

73KB
1.5K SLoC

cbsk_log is a log tool, the inspiration for this log writing library comes from fast_log

file split example

Cargo.toml:

cbsk_base = "2.0.2"
cbsk_log_rayon = "2.0.2"

main.rs:

use cbsk_base::log;
use cbsk_log_rayon::cbsk_log::config::Config;
use cbsk_log_rayon::cbsk_log::model::log_size::LogSize;
use cbsk_log_rayon::config::FileSplitTrait;
use cbsk_log_rayon::packer::zip_packer::ZipPacker;

fn main() {
    let config = Config::default().console().file_split("E:\\logs\\", LogSize::KB(5), ZipPacker::pack_end(|zip_path| {
        println!("{zip_path}");
    }));
    cbsk_log_rayon::init(config).unwrap();
    for i in 1..10000 {
        log::info!("hello world, {i}");
    }

    log::logger().flush();
}

console example

Cargo.toml:

cbsk_base = "2.0.2"
cbsk_log_rayon = "2.0.2"

main.rs:

use cbsk_base::log;
use cbsk_log_rayon::cbsk_log::config::Config;

fn main() {
    cbsk_log_rayon::init(Config::default().console()).unwrap();
    for i in 1..10000 {
        log::info!("hello world, {i}");
    }

    log::logger().flush();
}

Dependencies

~2.4–9.5MB
~99K SLoC