Skip to content

Commit

Permalink
Fix some logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peilun Li committed May 7, 2020
1 parent 2df03b2 commit fcba67b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion core/src/light_protocol/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ error_chain! {

pub fn handle(io: &dyn NetworkContext, peer: &NodeId, msg_id: MsgId, e: Error) {
warn!(
"Error while handling message, peer={}, msg_id={:?}, error={:?}",
"Error while handling message, peer={}, msg_id={:?}, error={}",
peer, msg_id, e
);

Expand Down
4 changes: 2 additions & 2 deletions core/src/light_protocol/handler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ impl NetworkProtocolHandler for Handler {
}

fn on_peer_connected(&self, io: &dyn NetworkContext, peer: &NodeId) {
info!("on_peer_connected: peer={:?}", peer);
debug!("on_peer_connected: peer={:?}", peer);

match self.send_status(io, peer) {
Ok(_) => {
Expand Down Expand Up @@ -664,7 +664,7 @@ impl NetworkProtocolHandler for Handler {
}

fn on_peer_disconnected(&self, _io: &dyn NetworkContext, peer: &NodeId) {
info!("on_peer_disconnected: peer={}", peer);
debug!("on_peer_disconnected: peer={}", peer);
self.peers.remove(peer);
}

Expand Down
4 changes: 2 additions & 2 deletions core/src/light_protocol/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ impl NetworkProtocolHandler for Provider {
}

fn on_peer_connected(&self, _io: &dyn NetworkContext, peer: &NodeId) {
info!("on_peer_connected: peer={:?}", peer);
debug!("on_peer_connected: peer={:?}", peer);

// insert handshaking peer, wait for StatusPing
self.peers.insert(*peer);
Expand All @@ -718,7 +718,7 @@ impl NetworkProtocolHandler for Provider {
}

fn on_peer_disconnected(&self, _io: &dyn NetworkContext, peer: &NodeId) {
info!("on_peer_disconnected: peer={}", peer);
debug!("on_peer_disconnected: peer={}", peer);
self.peers.remove(peer);
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/storage/impls/state_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct StateTrees {
pub snapshot_db: Arc<SnapshotDb>,
pub snapshot_epoch_id: EpochId,
pub snapshot_merkle_root: MerkleHash,
/// None means that the intermediate_trie is empty, or in a special
/// None means that the intermediate_trie is empty, or in a specia
/// situation that we use the snapshot at intermediate epoch directly,
/// so we don't need to look up intermediate trie.
pub maybe_intermediate_trie: Option<Arc<DeltaMpt>>,
Expand Down
2 changes: 1 addition & 1 deletion core/src/sync/message/get_block_headers_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl GetBlockHeadersResponse {
if ctx.manager.graph.verification_config.verify_timestamp {
let header_timestamp = header.timestamp();
if header_timestamp > now_timestamp {
warn!("Block {} timestamp {} is ahead of the current time {}. Potential time drift!", hash, header_timestamp, now_timestamp);
debug!("Block {} timestamp {} is ahead of the current time {}. Potential time drift!", hash, header_timestamp, now_timestamp);
}
if header_timestamp > now_timestamp + ACCEPTABLE_TIME_DRIFT {
warn!("The drift is more than the acceptable range ({}s). The processing of block {} will be delayed.", ACCEPTABLE_TIME_DRIFT, hash);
Expand Down
6 changes: 3 additions & 3 deletions core/src/sync/synchronization_protocol_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ impl SynchronizationProtocolHandler {
&self, io: &dyn NetworkContext, peer: &NodeId, msg_id: MsgId, e: Error,
) {
warn!(
"Error while handling message, peer={}, msgid={:?}, error={:?}",
"Error while handling message, peer={}, msgid={:?}, error={}",
peer, msg_id, e
);

Expand Down Expand Up @@ -1636,7 +1636,7 @@ impl NetworkProtocolHandler for SynchronizationProtocolHandler {
}

fn on_peer_connected(&self, io: &dyn NetworkContext, peer: &NodeId) {
info!("Peer connected: peer={:?}", peer);
debug!("Peer connected: peer={:?}", peer);
if let Err(e) = self.send_status(io, peer) {
debug!("Error sending status message: {:?}", e);
io.disconnect_peer(
Expand All @@ -1653,7 +1653,7 @@ impl NetworkProtocolHandler for SynchronizationProtocolHandler {
}

fn on_peer_disconnected(&self, io: &dyn NetworkContext, peer: &NodeId) {
info!("Peer disconnected: peer={}", peer);
debug!("Peer disconnected: peer={}", peer);
self.syn.peers.write().remove(peer);
self.syn.handshaking_peers.write().remove(peer);
self.request_manager.on_peer_disconnected(io, peer);
Expand Down

0 comments on commit fcba67b

Please sign in to comment.