Skip to content

Commit

Permalink
refactor: Reduce unnecessary log levels
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkingLee committed Nov 9, 2023
1 parent 7649719 commit cd8b7c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
14 changes: 6 additions & 8 deletions crates/das-network/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,12 @@ impl DasNetwork {
if let Err(e) = Swarm::listen_on(&mut swarm, listen_addr.parse().unwrap()) {
error!("Error starting to listen on {}: {}", listen_addr, e);
}

let metrics = match prometheus_registry {
Some(registry) => match Metrics::register(&registry) {
Ok(metrics) => Some(metrics),
Err(e) => {
error!(target: LOG_TARGET, "Failed to register metrics: {}", e);
None
},

let metrics = match prometheus_registry.as_ref().map(Metrics::register) {
Some(Ok(metrics)) => Some(metrics),
Some(Err(e)) => {
debug!(target: LOG_TARGET, "Failed to register metrics: {:?}", e);
None
},
None => None,
};
Expand Down
6 changes: 3 additions & 3 deletions crates/daser/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::{

use codec::{Decode, Encode};
use futures::lock::Mutex;
use log::info;
use log::{info, debug};
use melo_core_primitives::{
reliability::{ReliabilitySample, ReliabilityType},
traits::HeaderWithCommitment,
Expand Down Expand Up @@ -103,7 +103,7 @@ where
if self.network.fetch_sample(sample, commitment).await.is_some() {
sample.set_success();
} else {
info!("Sampled failed: {:?}", sample.id);
debug!("Sampled failed: {:?}", sample.id);
}
}

Expand Down Expand Up @@ -177,7 +177,7 @@ impl<H: HeaderWithCommitment + Sync, DB: DasKv + Send, D: DasNetworkOperations +
let commitments = header.commitments().context("Commitments not found in the header")?;

if !commitments.is_empty() {
info!("🌈 Sampling block {}, ID: {:?}", header.number(), id);
info!("🌈 Sampling block {}", header.number());

let extended_commits =
extend_fs_g1(self.network.kzg().get_fs(), &commitments).map_err(|e| anyhow!(e))?;
Expand Down

0 comments on commit cd8b7c1

Please sign in to comment.