Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions cmd/ethrex/initializers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,21 @@ pub fn init_tracing(opts: &Options) -> reload::Handle<EnvFilter, Registry> {

let (filter, filter_handle) = reload::Layer::new(log_filter);

let mut layer = fmt::layer();
let stdout_is_tty = std::io::stdout().is_terminal();
let use_color = match opts.log_color {
LogColor::Always => true,
LogColor::Never => false,
LogColor::Auto => stdout_is_tty,
};

if opts.log_color == LogColor::Never
|| (opts.log_color == LogColor::Auto && !std::io::stdout().is_terminal())
{
layer = layer.with_ansi(false);
}
let fmt_layer = fmt::layer()
.with_target(false)
.with_ansi(use_color)
.with_filter(filter);

let fmt_layer = layer.with_filter(filter);
let profiling_layer = opts.metrics_enabled.then_some(FunctionProfilingLayer);

let subscriber: Box<dyn tracing::Subscriber + Send + Sync> = if opts.metrics_enabled {
let profiling_layer = FunctionProfilingLayer;
Box::new(Registry::default().with(fmt_layer).with(profiling_layer))
} else {
Box::new(Registry::default().with(fmt_layer))
};
let subscriber = Registry::default().with(fmt_layer).with(profiling_layer);

tracing::subscriber::set_global_default(subscriber).expect("setting default subscriber failed");

Expand Down
2 changes: 1 addition & 1 deletion crates/blockchain/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ impl Blockchain {
}
// Store the added storage in the account's storage trie and compute its new root
if !update.added_storage.is_empty() {
debug!(count = update.added_storage.len(), "With storages");
trace!(count = update.added_storage.len(), "Update storages");
let (storage_trie, storage_updates_map) = storage_updates_map
.entry(hashed_address_h256)
.or_insert_with(|| {
Expand Down
2 changes: 1 addition & 1 deletion crates/networking/p2p/discv4/peer_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ impl PeerTableServer {
}
}
// No untried contact found, resetting tried peers.
tracing::info!("Resetting list of tried peers.");
tracing::trace!("Resetting list of tried peers.");
self.already_tried_peers.clear();
None
}
Expand Down
6 changes: 3 additions & 3 deletions crates/networking/p2p/tx_broadcaster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use spawned_concurrency::{
messages::Unused,
tasks::{CastResponse, GenServer, GenServerHandle, send_interval},
};
use tracing::{debug, error, info};
use tracing::{debug, error, info, trace};

use crate::{
discv4::peer_table::{PeerTable, PeerTableError},
Expand Down Expand Up @@ -184,7 +184,7 @@ impl TxBroadcaster {
.get_txs_for_broadcast()
.map_err(|_| TxBroadcasterError::Broadcast)?;
if txs_to_broadcast.is_empty() {
debug!("No transactions to broadcast");
trace!("No transactions to broadcast");
return Ok(());
}
let peers = self.peer_table.get_peers_with_capabilities().await?;
Expand Down Expand Up @@ -321,7 +321,7 @@ impl GenServer for TxBroadcaster {
) -> CastResponse {
match message {
Self::CastMsg::BroadcastTxs => {
debug!(received = "BroadcastTxs");
trace!(received = "BroadcastTxs");

let _ = self.broadcast_txs().await.inspect_err(|_| {
error!("Failed to broadcast transactions");
Expand Down
Loading