use systemd_journal_logger::{connected_to_journal, JournalLog}; /// If the current process is directly connected to the systemd journal, /// return a logger that will write to it. pub fn logger(identifier: String, extra_fields: I) -> std::io::Result> where I: IntoIterator, K: AsRef, V: AsRef<[u8]>, { Ok(Box::new( JournalLog::new()? .with_syslog_identifier(identifier) .with_extra_fields(extra_fields), )) } pub fn connected() -> bool { connected_to_journal() }