From 697d1ef62657f0825246b7ef3e404f5efa4550c5 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Sun, 3 Mar 2019 16:15:00 +1100 Subject: [PATCH] Add CLI option for log-level to test_harness --- beacon_node/beacon_chain/test_harness/src/bin.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/beacon_node/beacon_chain/test_harness/src/bin.rs b/beacon_node/beacon_chain/test_harness/src/bin.rs index b4a2cf05e..283cb0dfa 100644 --- a/beacon_node/beacon_chain/test_harness/src/bin.rs +++ b/beacon_node/beacon_chain/test_harness/src/bin.rs @@ -22,9 +22,20 @@ fn main() { .help("YAML file test_case.") .required(true), ) + .arg( + Arg::with_name("log") + .long("log-level") + .value_name("LOG_LEVEL") + .help("Logging level.") + .possible_values(&["error", "warn", "info", "debug", "trace"]) + .default_value("debug") + .required(true), + ) .get_matches(); - Builder::from_env(Env::default().default_filter_or("debug")).init(); + if let Some(log_level) = matches.value_of("log") { + Builder::from_env(Env::default().default_filter_or(log_level)).init(); + } if let Some(yaml_file) = matches.value_of("yaml") { let docs = {