From 39744df93f0ba67880f95c0ac75ac4e7a5a5ae62 Mon Sep 17 00:00:00 2001 From: Akihito Nakano Date: Fri, 30 May 2025 12:05:37 +0900 Subject: [PATCH] simulator: Fix `Failed to initialize dependency logging` (#7393) The simulator works but always emits the following message: ``` $ cargo run --release --bin simulator basic-sim ... ... Failed to initialize dependency logging: attempted to set a logger after the logging system was already initialized ... ... ``` This PR removes the initialization with `env_logger`. (Update) With https://github.com/sigp/lighthouse/pull/7433 merged, the libp2p/discv5 logs are saved in separate files and respect the `RUST_LOG` env var for log level configuration. --- Cargo.lock | 2 -- testing/simulator/Cargo.toml | 2 -- testing/simulator/src/main.rs | 4 ---- 3 files changed, 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1b506f6212..327908027c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8469,9 +8469,7 @@ name = "simulator" version = "0.2.0" dependencies = [ "clap", - "env_logger 0.9.3", "environment", - "eth2_network_config", "execution_layer", "futures", "kzg", diff --git a/testing/simulator/Cargo.toml b/testing/simulator/Cargo.toml index cf0d03c24f..cd23138a1c 100644 --- a/testing/simulator/Cargo.toml +++ b/testing/simulator/Cargo.toml @@ -7,9 +7,7 @@ edition = { workspace = true } [dependencies] clap = { workspace = true } -env_logger = { workspace = true } environment = { workspace = true } -eth2_network_config = { workspace = true } execution_layer = { workspace = true } futures = { workspace = true } kzg = { workspace = true } diff --git a/testing/simulator/src/main.rs b/testing/simulator/src/main.rs index 1cc4a1779b..7bd6e546f7 100644 --- a/testing/simulator/src/main.rs +++ b/testing/simulator/src/main.rs @@ -18,16 +18,12 @@ mod local_network; mod retry; use cli::cli_app; -use env_logger::{Builder, Env}; use local_network::LocalNetwork; use types::MinimalEthSpec; pub type E = MinimalEthSpec; fn main() { - // Debugging output for libp2p and external crates. - Builder::from_env(Env::default()).init(); - let matches = cli_app().get_matches(); match matches.subcommand_name() { Some("basic-sim") => match basic_sim::run_basic_sim(&matches) {