pub struct FileLoggerConfig { /* private fields */ }Expand description
Configuration for the rolling file logger.
Use FileLoggerConfig::new to set the destination directory and tune
the remaining fields with the with-style setters. The defaults are
daily rotation, a iroh-services filename prefix, and a 30-file
retention window.
Implementations§
Source§impl FileLoggerConfig
impl FileLoggerConfig
Sourcepub fn new<P: Into<PathBuf>>(dir: P) -> Self
pub fn new<P: Into<PathBuf>>(dir: P) -> Self
Build a config rooted at dir. The directory is created on first
write if it does not exist.
Sourcepub fn with_rotation(self, rotation: Rotation) -> Self
pub fn with_rotation(self, rotation: Rotation) -> Self
Override the rotation cadence. Default: Rotation::DAILY.
Sourcepub fn with_file_name_prefix<S: Into<String>>(self, prefix: S) -> Self
pub fn with_file_name_prefix<S: Into<String>>(self, prefix: S) -> Self
Override the file name stem. Rotation appends a date suffix to this.
Default: iroh-services.
Sourcepub fn with_max_files(self, max_files: Option<usize>) -> Self
pub fn with_max_files(self, max_files: Option<usize>) -> Self
Override the retention cap. None keeps every file forever; Some(n)
keeps at most n files and deletes the oldest on rotation. Default:
Some(30).
Trait Implementations§
Source§impl Clone for FileLoggerConfig
impl Clone for FileLoggerConfig
Source§fn clone(&self) -> FileLoggerConfig
fn clone(&self) -> FileLoggerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FileLoggerConfig
impl RefUnwindSafe for FileLoggerConfig
impl Send for FileLoggerConfig
impl Sync for FileLoggerConfig
impl Unpin for FileLoggerConfig
impl UnwindSafe for FileLoggerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more