protocol: downgrade warn! logs

Evaluate the `warn!` logging in `radicle-protocol`.

If the event is a result of something being suspicious in the running
of the protocol, then it remains a `warn!`.

However, if the system ends up ignoring the event and can continue
without issues, the log level is reduced to `debug!`.
This commit is contained in:
Fintan Halpenny
2026-01-19 17:56:56 +01:00
committed by Lorenz Leutgeb
parent 9236277abf
commit 95b3d10961
3 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -691,7 +691,7 @@ where
// If we're not seeding this repo, just skip it.
if !self.policies.is_seeding(&rid)? {
warn!(target: "service", "Local repository {rid} is not seeded");
debug!(target: "service", "Local repository {rid} is not seeded");
continue;
}
// Add public repositories to inventory.
@@ -1813,7 +1813,7 @@ where
let local = self.node_id();
let relay = self.config.is_relay();
let Some(peer) = self.sessions.get_mut(remote) else {
warn!(target: "service", "Session not found for {remote}");
debug!(target: "service", "Session not found for {remote}");
return Ok(());
};
peer.last_active = self.clock;
@@ -2537,7 +2537,7 @@ where
}
}
Err(err) => {
log::warn!(target: "protocol::filter", "Failed to check if {rid} exists: {err}");
log::debug!(target: "protocol::filter", "Failed to check if {rid} exists: {err}");
continue;
}
}
@@ -217,9 +217,9 @@ impl RefsStatus {
self.want.push(theirs);
}
Err(e) => {
log::warn!(
log::debug!(
target: "service",
"Error getting cached ref of {repo} for refs status: {e}"
"Failed to get cached 'rad/sigrefs' of {} in {repo} for refs status: {e}", theirs.remote,
);
}
}
@@ -301,7 +301,7 @@ impl Session {
pub fn fetched(&mut self, rid: RepoId) {
if let State::Connected { fetching, .. } = &mut self.state {
if !fetching.remove(&rid) {
log::warn!(target: "service", "Fetched unknown repository {rid}");
log::debug!(target: "service", "Fetched unknown repository {rid}");
}
}
}
@@ -319,7 +319,7 @@ impl Session {
self.last_active = since;
if let State::Connected { .. } = &self.state {
log::error!(target: "service", "Session {} is already in 'connected' state, resetting..", self.id);
log::debug!(target: "service", "Session {} is already in 'connected' state, resetting..", self.id);
};
self.state = State::Connected {
since,