cbsk_log_rayon

Crates.iocbsk_log_rayon
lib.rscbsk_log_rayon
version2.0.6
sourcesrc
created_at2024-08-26 10:47:27.703748
updated_at2024-11-15 03:30:53.987227
descriptioncbsk_log_rayon is a log tool, using tokio as the runtime
homepage
repositoryhttps://github.com/lifeRobot/cbsk/tree/master/libs/cbsk_log_rayon
max_upload_size
id1352079
size21,426
(lifeRobot)

documentation

README

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();
}
Commit count: 110

cargo fmt