2024-01-30 23:57:06 +08:00

14 lines
356 B
Rust

use rolling_file::{FileRoller, PeriodGap};
use std::io::Write;
use std::thread;
use std::time::Duration;
fn main() -> std::io::Result<()> {
let mut roller = FileRoller::new("output", 8, PeriodGap::Secondly);
for _ in 0..100 {
let _ = roller.write("hello".as_bytes())?;
thread::sleep(Duration::from_millis(100));
}
Ok(())
}