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§
Sourcefn create_console_log(&self) -> Result<Box<dyn Log>, LogControl1Error>
fn create_console_log(&self) -> Result<Box<dyn Log>, LogControl1Error>
Provided Methods§
Sourcefn create_journal_log(
&self,
syslog_identifier: String,
) -> Result<Box<dyn Log>, LogControl1Error>
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.