pub struct FileSinkBuilder<ArgPath> { /* private fields */ }
Expand description
Implementations§
Source§impl<ArgPath> FileSinkBuilder<ArgPath>
impl<ArgPath> FileSinkBuilder<ArgPath>
Sourcepub fn path<P>(self, path: P) -> FileSinkBuilder<PathBuf>
pub fn path<P>(self, path: P) -> FileSinkBuilder<PathBuf>
The path of the log file.
This parameter is required.
Sourcepub fn truncate(self, truncate: bool) -> Self
pub fn truncate(self, truncate: bool) -> Self
Truncates the contents when opening an existing file.
If it is true
, the existing contents of the file will be discarded.
This parameter is optional.
Sourcepub fn level_filter(self, level_filter: LevelFilter) -> Self
pub fn level_filter(self, level_filter: LevelFilter) -> Self
Specifies a log level filter.
This parameter is optional.
Sourcepub fn formatter(self, formatter: Box<dyn Formatter>) -> Self
pub fn formatter(self, formatter: Box<dyn Formatter>) -> Self
Specifies a formatter.
This parameter is optional.
Sourcepub fn error_handler(self, handler: ErrorHandler) -> Self
pub fn error_handler(self, handler: ErrorHandler) -> Self
Specifies an error handler.
This parameter is optional.
Source§impl FileSinkBuilder<PathBuf>
impl FileSinkBuilder<PathBuf>
Sourcepub fn build(self) -> Result<FileSink>
pub fn build(self) -> Result<FileSink>
Builds a FileSink
.
§Error
If an error occurs opening the file, Error::CreateDirectory
or
Error::OpenFile
will be returned.
Auto Trait Implementations§
impl<ArgPath> Freeze for FileSinkBuilder<ArgPath>where
ArgPath: Freeze,
impl<ArgPath> !RefUnwindSafe for FileSinkBuilder<ArgPath>
impl<ArgPath> Send for FileSinkBuilder<ArgPath>where
ArgPath: Send,
impl<ArgPath> Sync for FileSinkBuilder<ArgPath>where
ArgPath: Sync,
impl<ArgPath> Unpin for FileSinkBuilder<ArgPath>where
ArgPath: Unpin,
impl<ArgPath> !UnwindSafe for FileSinkBuilder<ArgPath>
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