Skip to content

Commit

Permalink
Merge pull request #199 from nervosnetwork/quake/log-level
Browse files Browse the repository at this point in the history
chore: tweak log level for some error message
  • Loading branch information
yangby-cryptape authored Aug 12, 2024
2 parents 8d42e56 + 8aa8568 commit bde18c9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/protocols/filter/block_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use ckb_constant::sync::INIT_BLOCKS_IN_TRANSIT_PER_PEER;
use ckb_network::{async_trait, bytes::Bytes, CKBProtocolContext, CKBProtocolHandler, PeerIndex};
use ckb_types::{core::BlockNumber, packed, prelude::*};
use golomb_coded_set::{GCSFilterReader, SipHasher24Builder, M, P};
use log::{debug, error, info, log_enabled, trace, warn, Level};
use log::{debug, info, log_enabled, trace, warn, Level};
use rand::seq::SliceRandom as _;
use std::io::Cursor;
use std::sync::RwLock;
Expand Down Expand Up @@ -259,7 +259,7 @@ impl FilterProtocol {
.build();
if let Err(err) = nc.send_message_to(peer, message.as_bytes()) {
let error_message = format!("nc.send_message GetBlockFilters, error: {:?}", err);
error!("{}", error_message);
info!("{}", error_message);
}
}

Expand All @@ -282,7 +282,7 @@ impl FilterProtocol {
.build();
if let Err(err) = nc.send_message_to(peer, message.as_bytes()) {
let error_message = format!("nc.send_message GetBlockFilterHashes, error: {:?}", err);
error!("{}", error_message);
info!("{}", error_message);
}
}

Expand All @@ -308,7 +308,7 @@ impl FilterProtocol {
"nc.send_message GetBlockFilterCheckPoints, error: {:?}",
err
);
error!("{}", error_message);
info!("{}", error_message);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/protocols/light_client/components/send_blocks_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use ckb_types::{
prelude::*,
utilities::merkle_mountain_range::VerifiableHeader,
};
use log::{debug, error};
use log::{debug, error, info};
use rand::seq::SliceRandom;

use crate::storage::HeaderWithExtension;
Expand Down Expand Up @@ -207,7 +207,7 @@ impl<'a> SendBlocksProofProcess<'a> {
) {
let error_message =
format!("nc.send_message SyncMessage, error: {:?}", err);
error!("{}", error_message);
info!("{}", error_message);
return StatusCode::Network.with_context(error_message);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/protocols/light_client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ impl LightClientProtocol {
) {
let error_message =
format!("nc.send_message LightClientMessage, error: {:?}", err);
error!("{}", error_message);
info!("{}", error_message);
}
self.peers.fetching_idle_headers(block_hashes, now);
}
Expand Down Expand Up @@ -788,7 +788,7 @@ impl LightClientProtocol {
) {
let error_message =
format!("nc.send_message LightClientMessage, error: {:?}", err);
error!("{}", error_message);
info!("{}", error_message);
}
self.peers.fetching_idle_txs(tx_hashes, now);
} else {
Expand Down
6 changes: 3 additions & 3 deletions src/utils/network.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::protocols::{Peers, GET_BLOCKS_PROOF_LIMIT};
use ckb_network::{CKBProtocolContext, SupportProtocols};
use ckb_types::{packed, prelude::*, H256};
use log::{debug, error};
use log::{debug, info};
use rand::seq::SliceRandom;
use std::collections::HashMap;
use std::sync::Arc;
Expand Down Expand Up @@ -53,7 +53,7 @@ pub(crate) fn prove_or_download_matched_blocks(
) {
let error_message =
format!("nc.send_message LightClientMessage, error: {:?}", err);
error!("{}", error_message);
info!("{}", error_message);
}
} else {
break;
Expand Down Expand Up @@ -97,7 +97,7 @@ pub(crate) fn prove_or_download_matched_blocks(
nc.send_message(SupportProtocols::Sync.protocol_id(), *peer_index, message)
{
let error_message = format!("nc.send_message SyncMessage, error: {:?}", err);
error!("{}", error_message);
info!("{}", error_message);
}
} else {
break;
Expand Down

0 comments on commit bde18c9

Please sign in to comment.