simulator: Write dependency logs to separate files (#7433)

This PR relates to:
- https://github.com/sigp/lighthouse/pull/7199
- -> workspace_filter has been enabled (dependency logging has been disabled)
- https://github.com/sigp/lighthouse/pull/7394
- -> file logging has been optionally enabled

Building on these, this PR enables dependency logging for the simulators. The logs are written to separate files.

The libp2p/discv5 logs:
- are saved to the directory  specified with `--log-dir`
- respects the `RUST_LOG` environment variable for log level configuration
This commit is contained in:
Akihito Nakano
2025-05-15 21:22:58 +09:00
committed by GitHub
parent 1853d836b7
commit c4182e362b
6 changed files with 64 additions and 24 deletions

View File

@@ -29,15 +29,15 @@ fn main() {
Builder::from_env(Env::default()).init();
let matches = cli_app().get_matches();
match matches.subcommand() {
Some(("basic-sim", matches)) => match basic_sim::run_basic_sim(matches) {
match matches.subcommand_name() {
Some("basic-sim") => match basic_sim::run_basic_sim(&matches) {
Ok(()) => println!("Simulation exited successfully"),
Err(e) => {
eprintln!("Simulation exited with error: {}", e);
std::process::exit(1)
}
},
Some(("fallback-sim", matches)) => match fallback_sim::run_fallback_sim(matches) {
Some("fallback-sim") => match fallback_sim::run_fallback_sim(&matches) {
Ok(()) => println!("Simulation exited successfully"),
Err(e) => {
eprintln!("Simulation exited with error: {}", e);