7 releases

0.3.4 Aug 17, 2022
0.3.3 May 5, 2022
0.2.1 May 3, 2022
0.1.0 May 3, 2022

#3 in #copy-file

Download history 95/week @ 2023-12-13 51/week @ 2023-12-20 18/week @ 2023-12-27 26/week @ 2024-01-03 27/week @ 2024-01-10 60/week @ 2024-01-17 67/week @ 2024-01-24 71/week @ 2024-01-31 76/week @ 2024-02-07 83/week @ 2024-02-14 79/week @ 2024-02-21 106/week @ 2024-02-28 127/week @ 2024-03-06 178/week @ 2024-03-13 79/week @ 2024-03-20 55/week @ 2024-03-27

466 downloads per month
Used in tsk-rs

Custom license

8KB
130 lines

simple-file-rotation

This is an implementation of simple FileRotation mechanism using only std. Given a file like my.log, it will copy that file to my.1.log, renaming a potentially pre-existing my.1.log to my.2.log. It accepts an optional number of max filesto keep. It will only rotate files when invoked, it will /not/ watch any files or do any kind of background processing.

use simple_file_rotation::{FileRotation};
FileRotation::new("my.log")
    .max_old_files(2)
    .rotate()?;

Why yet another file rotation library?

  • No additional dependencies.
  • No features I don't need.

lib.rs:

This is an implementation of simple FileRotation mechanism using only std. Given a file like my.log, it will copy that file to my.1.log, renaming a potentially pre-existing my.1.log to my.2.log. It accepts an optional number of max filesto keep. It will only rotate files when invoked, it will /not/ watch any files or do any kind of background processing.

use simple_file_rotation::{FileRotation};
FileRotation::new("my.log")
    .max_old_files(2)
    .rotate()?;

Why yet another file rotation library?

  • No additional dependencies.
  • No features I don't need.

No runtime deps