Uses new Rust 2021
|0.4.1||Aug 17, 2022|
|0.4.0||Aug 10, 2022|
|0.2.1||Dec 23, 2021|
|0.1.3||Dec 22, 2021|
#133 in Debugging
A WIP library which wraps the
io::Write trait to enable file rotation i.e. for logs. The goal is to enable file rotation at the file handle level and do so with as few dependencies as possible.
Implemented/planned rotation conditions:
- None (never rotate)
- SizeMB (file size)
- Duration (time since last modified)
- SizeLines (number of lines in file)
There are also three options to prune old logs:
This is currently in active development and may change/break often. Every effort will be taken to ensure that breaking changes that occur are reflected in a change of at least the minor version of the package, both in terms of the API and the generation of log files. Versions prior to 0.2.0 were so riddled with bugs I'm amazed I managed to put my pants on on those days I was writing it.
See docs here for notes on how it works, example usage, and error handling.
- Refresh internal index when rotation requested, not just at logger creation
- Be more careful around edgecases for example rotating on 1mb files and writing exactly 1mb to disk
- More direct integration with dedicated logging libraries, i.e.
- Investigate integration with things like
- More flexible rotation options
It's a metal thing that rotates, and also the name of the Billy Joel album which has
Summer, Highland Falls on it, one of my favourite songs.