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(()) }