Skip to content

Commit

Permalink
Merge pull request #1360 from subspace/dsn-modify-logging
Browse files Browse the repository at this point in the history
Modify logging messages for networking.
  • Loading branch information
shamil-gadelshin authored Apr 7, 2023
2 parents c43d1e6 + 60c8c52 commit d1f178f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -466,11 +466,7 @@ impl<'a> ParityDbProviderRecordIterator<'a> {
fn next_entry(&mut self) -> Option<(Vec<u8>, Vec<u8>)> {
if let Some(ref mut iter) = self.iter {
match iter.next() {
Ok(value) => {
trace!("Parity DB provider record iterator succeeded");

value
}
Ok(value) => value,
Err(err) => {
warn!(?err, "Parity DB provider record iterator error");

Expand Down Expand Up @@ -631,11 +627,7 @@ impl<'a> ParityDbProviderRecordCollectionIterator<'a> {
fn next_entry(&mut self) -> Option<(Vec<u8>, Vec<u8>)> {
if let Some(ref mut iter) = self.iter {
match iter.next() {
Ok(value) => {
trace!("Parity DB provider iterator succeeded");

value
}
Ok(value) => value,
Err(err) => {
warn!(?err, "Parity DB provider iterator error");

Expand Down
9 changes: 8 additions & 1 deletion crates/subspace-networking/src/node_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ where
let network_info = self.swarm.network_info();
let connections = network_info.connection_counters();

debug!(?connections, "Current connections and limits.");

(
connections.num_pending_outgoing()
+ connections.num_established_outgoing()
Expand Down Expand Up @@ -389,7 +391,12 @@ where
};

let is_reserved_peer = self.reserved_peers.contains_key(&peer_id);
debug!(%peer_id, %is_reserved_peer, "Connection established [{num_established} from peer]");
debug!(
%peer_id,
%is_reserved_peer,
?endpoint,
"Connection established [{num_established} from peer]"
);

// TODO: Workaround for https://github.com/libp2p/rust-libp2p/discussions/3418
self.established_connections
Expand Down

0 comments on commit d1f178f

Please sign in to comment.