From ada492f6996db72f256775332d4f669b9bc513bb Mon Sep 17 00:00:00 2001 From: cloudhead Date: Fri, 22 Mar 2024 18:00:48 +0100 Subject: [PATCH] node: Improve logging more --- radicle-fetch/src/state.rs | 4 ++-- radicle-node/src/service.rs | 2 ++ radicle-node/src/service/io.rs | 13 ++++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/radicle-fetch/src/state.rs b/radicle-fetch/src/state.rs index f12f744ca..2710c56cd 100644 --- a/radicle-fetch/src/state.rs +++ b/radicle-fetch/src/state.rs @@ -444,7 +444,7 @@ impl FetchState { )?; log::debug!( target: "fetch", - "Fetched data refs for {} remotes ({}ms)", + "Fetched data refs for {} remote(s) ({}ms)", fetched.len(), start.elapsed().as_millis() ); @@ -562,7 +562,7 @@ impl FetchState { } log::debug!( target: "fetch", - "Validated {} remotes ({}ms)", + "Validated {} remote(s) ({}ms)", remotes.len(), start.elapsed().as_millis() ); diff --git a/radicle-node/src/service.rs b/radicle-node/src/service.rs index ef794c797..84b201eec 100644 --- a/radicle-node/src/service.rs +++ b/radicle-node/src/service.rs @@ -1863,6 +1863,8 @@ where let peers = self.sessions.connected().map(|(_, p)| p); let (ann, refs) = self.refs_announcement_for(rid, remotes)?; + debug!(target: "service", "Announcing refs for {rid} to peers.."); + // Update our local sync status. This is useful for determining if refs were updated while // the node was stopped. if let Some(refs) = refs.iter().find(|r| r.remote == ann.node) { diff --git a/radicle-node/src/service/io.rs b/radicle-node/src/service/io.rs index b04daea5c..f4f88503c 100644 --- a/radicle-node/src/service/io.rs +++ b/radicle-node/src/service/io.rs @@ -57,7 +57,7 @@ impl Outbox { } pub fn write(&mut self, remote: &Session, msg: Message) { - msg.log(log::Level::Trace, &remote.id, Link::Outbound); + msg.log(log::Level::Debug, &remote.id, Link::Outbound); trace!(target: "service", "Write {:?} to {}", &msg, remote); self.io.push_back(Io::Write(remote.id, vec![msg])); @@ -81,7 +81,18 @@ impl Outbox { if let Some(subscribe) = &peer.subscribe { if subscribe.filter.contains(&refs.rid) { self.write(peer, ann.clone().into()); + } else { + debug!( + target: "service", + "Skipping refs announcement relay to {peer}: peer isn't subscribed to {}", + refs.rid + ); } + } else { + debug!( + target: "service", + "Skipping refs announcement relay to {peer}: peer didn't send a subscription filter" + ); } } else { self.write(peer, ann.clone().into());