mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 16:55:46 +00:00
CLI tests for logging flags (#3609)
## Issue Addressed Adding CLI tests for logging flags: log-color and disable-log-timestamp Which issue # does this PR address? #3588 ## Proposed Changes Add CLI tests for logging flags as described in #3588 Please list or describe the changes introduced by this PR. Added logger_config to client::Config as suggested. Implemented Default for LoggerConfig based on what was being done elsewhere in the repo. Created 2 tests for each flag addressed. ## Additional Info Please provide any additional information. For example, future considerations or information useful for reviewers.
This commit is contained in:
@@ -438,9 +438,9 @@ fn run<E: EthSpec>(
|
||||
|
||||
let logger_config = LoggerConfig {
|
||||
path: log_path,
|
||||
debug_level,
|
||||
logfile_debug_level,
|
||||
log_format,
|
||||
debug_level: String::from(debug_level),
|
||||
logfile_debug_level: String::from(logfile_debug_level),
|
||||
log_format: log_format.map(String::from),
|
||||
log_color,
|
||||
disable_log_timestamp,
|
||||
max_log_size: logfile_max_size * 1_024 * 1_024,
|
||||
@@ -448,7 +448,7 @@ fn run<E: EthSpec>(
|
||||
compression: logfile_compress,
|
||||
};
|
||||
|
||||
let builder = environment_builder.initialize_logger(logger_config)?;
|
||||
let builder = environment_builder.initialize_logger(logger_config.clone())?;
|
||||
|
||||
let mut environment = builder
|
||||
.multi_threaded_tokio_runtime()?
|
||||
@@ -528,7 +528,8 @@ fn run<E: EthSpec>(
|
||||
let context = environment.core_context();
|
||||
let log = context.log().clone();
|
||||
let executor = context.executor.clone();
|
||||
let config = beacon_node::get_config::<E>(matches, &context)?;
|
||||
let mut config = beacon_node::get_config::<E>(matches, &context)?;
|
||||
config.logger_config = logger_config;
|
||||
let shutdown_flag = matches.is_present("immediate-shutdown");
|
||||
// Dump configs if `dump-config` or `dump-chain-config` flags are set
|
||||
clap_utils::check_dump_configs::<_, E>(matches, &config, &context.eth2_config.spec)?;
|
||||
|
||||
Reference in New Issue
Block a user