Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Upstream #3

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open

Merge Upstream #3

wants to merge 47 commits into from

Conversation

archis-polyverse
Copy link

No description provided.

kstrafe and others added 30 commits July 7, 2020 00:31
Add mode to write complete record (even if bytes may be surpassed)
…heme (#7)

* "allow to add timestamp suffix to log path" PR by gfreezy

squashed and rebased by Erlend Langseth <[email protected]>

* Extensible suffix behaviour (timestamp, count) through trait SuffixScheme

In the count case, changed from unintuitive O(1) renaming, to intuitive
O(N) cascade of renames.

* Make chrono dep optional

* Fix clippy warnings and errors

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.

* Add timestamp_age_rotation test, fix a bug

Bug:
 - have to use NaiveDateTime to parse timezone-less string, and not DateTime
 - suffix_to_string was wrong

- and adjust some tests

* Document how to use age as file limit

Co-authored-by: Alex.F <[email protected]>
Now the SuffixScheme functions don't do file operations. FileRotate
takes care of cascading files if necessary, removing files, keeping
track of log paths etc.
one write fails but subsequently works fine
- delete a function that was never used: `TimestampSuffixScheme::should_rotate`
- expose fields of `TimestampSuffixScheme`
- bug fix: basically the previous commit only made matters worse - now
  a real fix + a test
- bump to v0.6.0 because of breaking change
- some changes to docs
With rotation options: Hourly, Daily, Weekly, Monthly, Yearly.
And timestamp from yesterday, hour before, or now.
Add test to rotate by date.
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.

8 participants