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

#8 in #copy-file

Download history 194/week @ 2024-10-19 172/week @ 2024-10-26 85/week @ 2024-11-02 109/week @ 2024-11-09 147/week @ 2024-11-16 123/week @ 2024-11-23 150/week @ 2024-11-30 180/week @ 2024-12-07 139/week @ 2024-12-14 27/week @ 2024-12-21 35/week @ 2024-12-28 52/week @ 2025-01-04 70/week @ 2025-01-11 161/week @ 2025-01-18 240/week @ 2025-01-25 166/week @ 2025-02-01

642 downloads per month
Used in 2 crates

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