Skip to content

Conversation

@Ploppz
Copy link
Collaborator

@Ploppz Ploppz commented Aug 25, 2021

I built on a PR by @gfreezy (@gfreezy, maybe this PR is interesting to you), but basically did a rewrite, fixing:

  • Make timestamp suffix optional, with extensible suffix behaviour through a trait
  • Make chrono dep optional
  • If you restart your application, the writer will look at the existing files to keep track of all the log files (in the timestamp suffix case)
  • FileLimit::Age

Additionally:

  • In the count case, changed from unintuitive O(1) renaming, to intuitive O(N) cascade of renames.
  • s/RotationMode/ContentLimit
  • And more

gfreezy and others added 6 commits August 25, 2021 14:14
…heme

In the count case, changed from unintuitive O(1) renaming, to intuitive
O(N) cascade of renames.
There were errors like
```
error: written amount is not handled. Use `Write::write_all` instead
   --> src/lib.rs:278:25
    |
278 |                         file.write(&buf[..bytes_left])?;
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[deny(clippy::unused_io_amount)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_io_amount
```

Seems like a good catch by clippy.
Bug:
 - have to use NaiveDateTime to parse timezone-less string, and not DateTime
 - suffix_to_string was wrong

- and adjust some tests
@Ploppz Ploppz mentioned this pull request Sep 1, 2021
@kstrafe kstrafe merged commit b48f906 into kstrafe:master Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants