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 12:04:09 +00:00 committed by Lorenz Leutgeb
parent 9236277abf
commit 95b3d10961
3 changed files with 7 additions and 7 deletions

View File

@ -691,7 +691,7 @@ where
// If we're not seeding this repo, just skip it. // If we're not seeding this repo, just skip it.
if !self.policies.is_seeding(&rid)? { 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; continue;
} }
// Add public repositories to inventory. // Add public repositories to inventory.
@ -1813,7 +1813,7 @@ where
let local = self.node_id(); let local = self.node_id();
let relay = self.config.is_relay(); let relay = self.config.is_relay();
let Some(peer) = self.sessions.get_mut(remote) else { 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(()); return Ok(());
}; };
peer.last_active = self.clock; peer.last_active = self.clock;
@ -2537,7 +2537,7 @@ where
} }
} }
Err(err) => { 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; continue;
} }
} }

View File

@ -217,9 +217,9 @@ impl RefsStatus {
self.want.push(theirs); self.want.push(theirs);
} }
Err(e) => { Err(e) => {
log::warn!( log::debug!(
target: "service", 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,
); );
} }
} }

View File

@ -301,7 +301,7 @@ impl Session {
pub fn fetched(&mut self, rid: RepoId) { pub fn fetched(&mut self, rid: RepoId) {
if let State::Connected { fetching, .. } = &mut self.state { if let State::Connected { fetching, .. } = &mut self.state {
if !fetching.remove(&rid) { 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; self.last_active = since;
if let State::Connected { .. } = &self.state { 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 { self.state = State::Connected {
since, since,