LogFactory

Trait LogFactory 

Source
pub trait LogFactory {
    // Required method
    fn create_console_log(&self) -> Result<Box<dyn Log>, LogControl1Error>;

    // Provided method
    fn create_journal_log(
        &self,
        syslog_identifier: String,
    ) -> Result<Box<dyn Log>, LogControl1Error> { ... }
}
Expand description

A factory for log implementations.

Required Methods§

Source

fn create_console_log(&self) -> Result<Box<dyn Log>, LogControl1Error>

Create a logger for the console log target.

§Errors

Return an error if creating the logger failed.

Provided Methods§

Source

fn create_journal_log( &self, syslog_identifier: String, ) -> Result<Box<dyn Log>, LogControl1Error>

Create a logger for journal log target.

The implementation should use syslog_identifier for the corresponding journal field.

The default implementation creates a systemd_journal_logger::JournalLog.

§Errors

Return LogControl1Error::InputOutputError if journald is unavailable.

Implementors§