node: Improve logging more

This commit is contained in:
cloudhead 2024-03-22 18:00:48 +01:00
parent a4928f50b6
commit ada492f699
No known key found for this signature in database
3 changed files with 16 additions and 3 deletions

View File

@ -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()
);

View File

@ -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) {

View File

@ -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());