Trait flexi_logger::writers::LogWriter
source · pub trait LogWriter: Sync + Send {
// Required methods
fn write(&self, now: &mut DeferredNow, record: &Record<'_>) -> Result<()>;
fn flush(&self) -> Result<()>;
// Provided methods
fn max_log_level(&self) -> LevelFilter { ... }
fn format(&mut self, format: FormatFunction) { ... }
fn shutdown(&self) { ... }
}
Expand description
Writes to a single log output stream.
Boxed instances of LogWriter
can be used as additional log targets
(see writers for more details).
Required Methods§
Provided Methods§
sourcefn max_log_level(&self) -> LevelFilter
fn max_log_level(&self) -> LevelFilter
Provides the maximum log level that is to be written.
sourcefn format(&mut self, format: FormatFunction)
fn format(&mut self, format: FormatFunction)
Sets the format function.
Defaults to default_format
,
but can be changed with a call to
Logger::format_for_writer
.
The default implementation is a no-op.