Enum flexi_logger::Cleanup
source · [−]pub enum Cleanup {
Never,
KeepLogFiles(usize),
KeepCompressedFiles(usize),
KeepLogAndCompressedFiles(usize, usize),
}
Expand description
Defines the strategy for handling older log files.
Is used in Logger::rotate
.
Note that if you use a strategy other than Cleanup::Never
, then the cleanup work is
by default done in an extra thread, to minimize the impact on the program.
See LoggerHandle::shutdown
to avoid interrupting a currently active cleanup when your program terminates.
See
Logger::cleanup_in_background_thread
if you want to control whether this extra thread is created and used.
Variants
Never
Older log files are not touched - they remain for ever.
KeepLogFiles(usize)
The specified number of rotated log files are kept. Older files are deleted, if necessary.
KeepCompressedFiles(usize)
compress
only.The specified number of rotated log files are compressed and kept. Older files are deleted, if necessary.
KeepLogAndCompressedFiles(usize, usize)
compress
only.Allows keeping some files as text files and some as compressed files.
Example
KeepLogAndCompressedFiles(5,30)
ensures that the youngest five log files are
kept as text files, the next 30 are kept as compressed files with additional suffix .gz
,
and older files are removed.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Cleanup
impl Send for Cleanup
impl Sync for Cleanup
impl Unpin for Cleanup
impl UnwindSafe for Cleanup
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more