[][src]Trait flexi_logger::writers::LogWriter

pub trait LogWriter: Sync + Send {
    pub fn write(
        &self,
        now: &mut DeferredNow,
        record: &Record<'_>
    ) -> Result<()>;
pub fn flush(&self) -> Result<()>;
pub fn max_log_level(&self) -> LevelFilter; pub fn format(&mut self, format: FormatFunction) { ... }
pub fn shutdown(&self) { ... } }

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

pub fn write(&self, now: &mut DeferredNow, record: &Record<'_>) -> Result<()>[src]

Writes out a log line.

Errors

std::io::Error

pub fn flush(&self) -> Result<()>[src]

Flushes any buffered records.

Errors

std::io::Error

pub fn max_log_level(&self) -> LevelFilter[src]

Provides the maximum log level that is to be written.

Loading content...

Provided methods

pub fn format(&mut self, format: FormatFunction)[src]

Sets the format function. Defaults to (formats::default_format), but can be changed with a call to Logger::format_for_writer.

The default implementation is a no-op.

pub fn shutdown(&self)[src]

Cleanup open resources, if necessary.

Loading content...

Implementors

impl LogWriter for FileLogWriter[src]

impl LogWriter for SyslogWriter[src]

Loading content...