Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify logging messages for networking. #1360

Merged
merged 1 commit into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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