1use std::process;
2use std::thread;
3use std::time::Duration;
4use toolkit_rs::{
5 logger::{self, LogConfig, LogStyle},
6 painc::{set_panic_handler, PaincConf},
7};
8fn main() {
10 set_panic_handler(PaincConf::default());
11 let mut cfg = LogConfig::default();
12 cfg.style = LogStyle::Module;
13 cfg.size_mb = 1;
14 cfg.keep_day = 2;
15 cfg.cleanup_sync = Some(false);
16 logger::setup(cfg).unwrap_or_else(|e| {
17 println!("log setup err:{}", e);
18 process::exit(1);
19 });
20
21 for i in 0..5024 {
22 log::debug!("this is a debug log..{}", i);
23 log::info!("this is a info log..{}", i);
24 log::warn!("this is a warn log..{}", i);
25 log::error!("this is a error log..{}", i);
26 }
27
28 }