rbatis / fast_log

Rust async log High-performance asynchronous logging
Apache License 2.0
251 stars 13 forks source link

lost logs #10

Closed whitelilis closed 2 years ago

whitelilis commented 2 years ago

just test the following code:

use std::time::Duration;

use fast_log::config::Config; use fast_log::consts::LogSize; use fast_log::plugin::file_split::RollingType; use fast_log::plugin::packer::LogPacker; use fast_log::sleep; use log::info;

pub fn main() { fast_log::init(Config::new().file_split( "target/logs/", LogSize::MB(100), RollingType::All, LogPacker {}, )) .unwrap(); for i in 0..100_0000 { info!("Commencing yak shaving {}", i); } sleep(Duration::from_secs(1)); }

1, Using sleep, not get. 1000000 logs. 2,using fast_log::flush().unwrap(), not either.

zhuxiujia commented 2 years ago

use log::logger().flush()