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.
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.