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

@@ -37,7 +37,11 @@ pub fn construct_logger<E: EthSpec>(
environment_builder.init_tracing(logger_config.clone(), logfile_prefix);
let libp2p_discv5_layer = if let Some(subcommand_name) = subcommand_name {
if subcommand_name == "beacon_node" || subcommand_name == "boot_node" {
if subcommand_name == "beacon_node"
|| subcommand_name == "boot_node"
|| subcommand_name == "basic-sim"
|| subcommand_name == "fallback-sim"
{
if logger_config.max_log_size == 0 || logger_config.max_log_number == 0 {
// User has explicitly disabled logging to file.
None