Skip to content

Commit

Permalink
chore(code): Lower most gossip output from debug to trace
Browse files Browse the repository at this point in the history
  • Loading branch information
romac committed Jun 4, 2024
1 parent 2ae7f78 commit ba6ff65
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions code/gossip-mempool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ async fn run(
};

for persistent_peer in config.persistent_peers {
debug!("Dialing persistent peer: {persistent_peer}");
trace!("Dialing persistent peer: {persistent_peer}");

match swarm.dial(persistent_peer.clone()) {
Ok(()) => (),
Expand Down Expand Up @@ -175,7 +175,7 @@ async fn handle_ctrl_msg(msg: CtrlMsg, swarm: &mut swarm::Swarm<Behaviour>) -> C

match result {
Ok(message_id) => {
debug!("Broadcasted message {message_id} of {msg_size} bytes");
trace!("Broadcasted message {message_id} of {msg_size} bytes");
}
Err(e) => {
error!("Error broadcasting message: {e}");
Expand Down Expand Up @@ -206,7 +206,7 @@ async fn handle_swarm_event(
}

SwarmEvent::Behaviour(NetworkEvent::Identify(identify::Event::Sent { peer_id })) => {
debug!("Sent identity to {peer_id}");
trace!("Sent identity to {peer_id}");
}

SwarmEvent::Behaviour(NetworkEvent::Identify(identify::Event::Received {
Expand All @@ -219,7 +219,7 @@ async fn handle_swarm_event(
);

if info.protocol_version == PROTOCOL_VERSION {
debug!(
trace!(
"Connecting to peer {peer_id} using protocol {:?}",
info.protocol_version
);
Expand All @@ -228,7 +228,7 @@ async fn handle_swarm_event(

swarm.behaviour_mut().gossipsub.add_explicit_peer(&peer_id);
} else {
debug!(
trace!(
"Peer {peer_id} is using incompatible protocol version: {:?}",
info.protocol_version
);
Expand All @@ -240,12 +240,12 @@ async fn handle_swarm_event(
topic: topic_hash,
})) => {
if !Channel::has_topic(&topic_hash) {
debug!("Peer {peer_id} tried to subscribe to unknown topic: {topic_hash}");
trace!("Peer {peer_id} tried to subscribe to unknown topic: {topic_hash}");

return ControlFlow::Continue(());
}

debug!("Peer {peer_id} subscribed to {topic_hash}");
trace!("Peer {peer_id} subscribed to {topic_hash}");

if let Err(e) = tx_event.send(Event::PeerConnected(peer_id)).await {
error!("Error sending peer connected event to handle: {e}");
Expand Down
14 changes: 7 additions & 7 deletions code/gossip/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ async fn run(
};

for persistent_peer in config.persistent_peers {
debug!("Dialing persistent peer: {persistent_peer}");
trace!("Dialing persistent peer: {persistent_peer}");

match swarm.dial(persistent_peer.clone()) {
Ok(()) => (),
Expand Down Expand Up @@ -222,7 +222,7 @@ async fn handle_swarm_event(
);

if info.protocol_version == PROTOCOL_VERSION {
debug!(
trace!(
"Peer {peer_id} is using compatible protocol version: {:?}",
info.protocol_version
);
Expand All @@ -231,7 +231,7 @@ async fn handle_swarm_event(

swarm.behaviour_mut().gossipsub.add_explicit_peer(&peer_id);
} else {
debug!(
trace!(
"Peer {peer_id} is using incompatible protocol version: {:?}",
info.protocol_version
);
Expand All @@ -243,11 +243,11 @@ async fn handle_swarm_event(
topic,
})) => {
if !Channel::has_topic(&topic) {
debug!("Peer {peer_id} tried to subscribe to unknown topic: {topic}");
trace!("Peer {peer_id} tried to subscribe to unknown topic: {topic}");
return ControlFlow::Continue(());
}

debug!("Peer {peer_id} subscribed to {topic}");
trace!("Peer {peer_id} subscribed to {topic}");

if let Err(e) = tx_event.send(Event::PeerConnected(peer_id)).await {
error!("Error sending peer connected event to handle: {e}");
Expand All @@ -260,11 +260,11 @@ async fn handle_swarm_event(
topic,
})) => {
if !Channel::has_topic(&topic) {
debug!("Peer {peer_id} tried to unsubscribe from unknown topic: {topic}");
trace!("Peer {peer_id} tried to unsubscribe from unknown topic: {topic}");
return ControlFlow::Continue(());
}

debug!("Peer {peer_id} unsubscribed from {topic}");
trace!("Peer {peer_id} unsubscribed from {topic}");

if let Err(e) = tx_event.send(Event::PeerDisconnected(peer_id)).await {
error!("Error sending peer disconnected event to handle: {e}");
Expand Down

0 comments on commit ba6ff65

Please sign in to comment.