pub struct FileSink { /* private fields */ }
Expand description
Implementations§
source§impl FileSink
impl FileSink
sourcepub fn builder() -> FileSinkBuilder<()>
pub fn builder() -> FileSinkBuilder<()>
Constructs a builder of FileSink
.
sourcepub fn new<P>(path: P, truncate: bool) -> Result<FileSink>
👎Deprecated since 0.3.0: it may be removed in the future, use FileSink::builder()
instead
pub fn new<P>(path: P, truncate: bool) -> Result<FileSink>
FileSink::builder()
insteadConstructs a FileSink
.
If the parameter truncate
is true
, the existing contents of the file
will be discarded.
§Errors
If an error occurs opening the file, Error::CreateDirectory
or
Error::OpenFile
will be returned.
Trait Implementations§
source§impl Sink for FileSink
impl Sink for FileSink
source§fn level_filter(&self) -> LevelFilter
fn level_filter(&self) -> LevelFilter
Gets the log level filter.
source§fn set_level_filter(&self, level_filter: LevelFilter)
fn set_level_filter(&self, level_filter: LevelFilter)
Sets the log level filter.
source§fn set_formatter(&self, formatter: Box<dyn Formatter>)
fn set_formatter(&self, formatter: Box<dyn Formatter>)
Sets the formatter.
source§fn set_error_handler(&self, handler: Option<ErrorHandler>)
fn set_error_handler(&self, handler: Option<ErrorHandler>)
Sets a error handler. Read more
source§fn should_log(&self, level: Level) -> bool
fn should_log(&self, level: Level) -> bool
Determines if a log message with the specified level would be logged.
Auto Trait Implementations§
impl !RefUnwindSafe for FileSink
impl Send for FileSink
impl Sync for FileSink
impl Unpin for FileSink
impl !UnwindSafe for FileSink
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