Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
node: Improve logging more
cloudhead committed 2 years ago
commit ada492f6996db72f256775332d4f669b9bc513bb
parent a4928f50b6d88495f13ff2d7db3157c920417345
3 files changed +16 -3
modified 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()
        );
modified 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) {
modified 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());