Less logging in tangled

This commit is contained in:
IQuant 2024-10-13 14:51:23 +03:00
parent ff52f046e4
commit d71e78a080

View file

@ -25,7 +25,7 @@ use quinn::{
}; };
use thiserror::Error; use thiserror::Error;
use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::io::{AsyncReadExt, AsyncWriteExt};
use tracing::{debug, error, info, trace, warn}; use tracing::{debug, error, trace, warn};
use crate::{ use crate::{
common::{Destination, NetworkEvent, PeerId, PeerState, Reliability, Settings}, common::{Destination, NetworkEvent, PeerId, PeerState, Reliability, Settings},
@ -243,7 +243,7 @@ impl ConnectionManager {
let mut peer_id_counter = 1; let mut peer_id_counter = 1;
while shared.keep_alive.load(Ordering::Relaxed) { while shared.keep_alive.load(Ordering::Relaxed) {
let Some(incoming) = endpoint.accept().await else { let Some(incoming) = endpoint.accept().await else {
info!("Endpoint closed, stopping connection accepter task."); debug!("Endpoint closed, stopping connection accepter task.");
return; return;
}; };
match DirectPeer::accept(shared.clone(), incoming, PeerId(peer_id_counter)).await { match DirectPeer::accept(shared.clone(), incoming, PeerId(peer_id_counter)).await {
@ -323,7 +323,7 @@ impl ConnectionManager {
.send(NetworkEvent::PeerConnected(peer_id)) .send(NetworkEvent::PeerConnected(peer_id))
.expect("channel to be open"); .expect("channel to be open");
self.shared.remote_peers.insert(peer_id, RemotePeer); self.shared.remote_peers.insert(peer_id, RemotePeer);
info!( debug!(
"Peer {} connected, total connected: {}", "Peer {} connected, total connected: {}",
peer_id, peer_id,
self.shared.remote_peers.len() self.shared.remote_peers.len()
@ -352,7 +352,7 @@ impl ConnectionManager {
} }
} }
InternalEvent::Disconnected(peer_id) => { InternalEvent::Disconnected(peer_id) => {
info!("Peer {} disconnected", peer_id); debug!("Peer {} disconnected", peer_id);
self.shared.direct_peers.remove(&peer_id); self.shared.direct_peers.remove(&peer_id);
self.shared self.shared
.inbound_channel .inbound_channel