Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
node/log: Define syslog identifier
✓ CI success Lorenz Leutgeb committed 7 months ago
commit 9b2f737a64a153d393be8f4814feb7c7a8aa91f3
parent ee49e28766ce7c703b95e22d177cce046072f03d
1 passed (1 total) View logs
2 files changed +5 -4
modified crates/radicle-node/src/main.rs
@@ -338,7 +338,8 @@ fn initialize_logging(options: &LogOptions) -> Result<(), Box<dyn std::error::Er
                    return Err(Box::new(JournalError::NotConnected));
                }

-
                logger::<&str, &str, _>("radicle-node".to_string(), []).map_err(Box::new)?
+
                const SYSLOG_IDENTIFIER: &str = "radicle-node";
+
                logger::<&str, &str, _>(SYSLOG_IDENTIFIER.to_string(), []).map_err(Box::new)?
            }
            Logger::Radicle => Box::new(radicle::logger::Logger::new(level)),
        }
modified crates/radicle-systemd/src/journal.rs
@@ -1,9 +1,9 @@
-
use systemd_journal_logger::{connected_to_journal, current_exe_identifier, JournalLog};
+
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<K, V, I>(
-
    default_identifier: String,
+
    identifier: String,
    extra_fields: I,
) -> std::io::Result<Box<dyn log::Log>>
where
@@ -13,7 +13,7 @@ where
{
    Ok(Box::new(
        JournalLog::new()?
-
            .with_syslog_identifier(current_exe_identifier().unwrap_or(default_identifier))
+
            .with_syslog_identifier(identifier)
            .with_extra_fields(extra_fields),
    ))
}