Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 0eeee4d

Browse files
arkparbkchr
authored andcommitted
Less verbose console output (#4029)
1 parent 7f2051b commit 0eeee4d

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

core/network/src/discovery.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ use libp2p::multiaddr::Protocol;
6363
use log::{debug, info, trace, warn};
6464
use std::{cmp, collections::VecDeque, time::Duration};
6565
use tokio_io::{AsyncRead, AsyncWrite};
66+
use primitives::hexdisplay::HexDisplay;
6667

6768
/// Implementation of `NetworkBehaviour` that discovers the nodes on the network.
6869
pub struct DiscoveryBehaviour<TSubstream> {
@@ -316,16 +317,16 @@ where
316317
KademliaEvent::GetClosestPeersResult(res) => {
317318
match res {
318319
Err(GetClosestPeersError::Timeout { key, peers }) => {
319-
warn!(target: "sub-libp2p",
320-
"Libp2p => Query for {:?} timed out with {:?} results",
321-
key, peers.len());
320+
debug!(target: "sub-libp2p",
321+
"Libp2p => Query for {:?} timed out with {} results",
322+
HexDisplay::from(&key), peers.len());
322323
},
323324
Ok(ok) => {
324325
trace!(target: "sub-libp2p",
325326
"Libp2p => Query for {:?} yielded {:?} results",
326-
ok.key, ok.peers.len());
327+
HexDisplay::from(&ok.key), ok.peers.len());
327328
if ok.peers.is_empty() && self.num_connections != 0 {
328-
warn!(target: "sub-libp2p", "Libp2p => Random Kademlia query has yielded empty \
329+
debug!(target: "sub-libp2p", "Libp2p => Random Kademlia query has yielded empty \
329330
results");
330331
}
331332
}

core/sr-io/with_std.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,17 +180,17 @@ impl OtherApi for () {
180180
}
181181

182182
fn print_num(val: u64) {
183-
println!("{}", val);
183+
log::debug!(target: "runtime", "{}", val);
184184
}
185185

186186
fn print_utf8(utf8: &[u8]) {
187187
if let Ok(data) = std::str::from_utf8(utf8) {
188-
println!("{}", data)
188+
log::debug!(target: "runtime", "{}", data)
189189
}
190190
}
191191

192192
fn print_hex(data: &[u8]) {
193-
println!("{}", HexDisplay::from(&data));
193+
log::debug!(target: "runtime", "{}", HexDisplay::from(&data));
194194
}
195195

196196
fn log(

0 commit comments

Comments
 (0)