forked from kstrafe/file-rotate
-
Notifications
You must be signed in to change notification settings - Fork 2
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
archis-polyverse
wants to merge
47
commits into
polyverse:main
Choose a base branch
from
kstrafe:master
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This adds a new `ContentLimit` that never rotates the log automatically. To force a rotation the user has to call `FileRotate::rotate()` which is not part of the public API.
- take `Option<OpenOptions>` in `FileRotate::new`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.