14 lines
357 B
Rust
14 lines
357 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(())
|
|
}
|