fix(kad): reduce noise of "remote supports our protocol" log

This PR changes the logging of the Kademlia connection handler related to the remote Kademlia mode changes:
- Downgrade log level for the remote kademlia protocol report from `info` to `debug`.
- Introduce connection_id for the handler to improve logging.

Pull-Request: #4278.
This commit is contained in:
shamil-gadelshin
2023-08-07 16:31:15 +07:00
committed by GitHub
parent 72fd50ae6c
commit e65155281e
8 changed files with 36 additions and 10 deletions

View File

@ -53,6 +53,7 @@ use libp2p_core::upgrade::{NegotiationError, ProtocolError};
use libp2p_core::Endpoint;
use libp2p_identity::PeerId;
use std::collections::HashSet;
use std::fmt::{Display, Formatter};
use std::future::Future;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::task::Waker;
@ -82,6 +83,12 @@ impl ConnectionId {
}
}
impl Display for ConnectionId {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
write!(f, "{}", self.0)
}
}
/// Information about a successfully established connection.
#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) struct Connected {