From 831ab0a5252034e3c766e9164406ceb40cd29b3a Mon Sep 17 00:00:00 2001 From: Antoni Spaanderman <49868160+antonilol@users.noreply.github.com> Date: Sun, 14 Jul 2024 20:40:40 +0200 Subject: [PATCH] deprecate unused config option `timestamp` (#1052) --- src/config.rs | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/config.rs b/src/config.rs index 9d9c95d58..d37ff35b2 100644 --- a/src/config.rs +++ b/src/config.rs @@ -146,7 +146,6 @@ pub struct Config { pub disable_electrum_rpc: bool, pub server_banner: String, pub signet_magic: Magic, - pub args: Vec, } pub struct SensitiveAuth(pub Auth); @@ -195,7 +194,7 @@ impl Config { pub fn from_args() -> Config { use internal::ResultExt; - let (mut config, args) = + let (mut config, _args) = internal::Config::including_optional_config_files(default_config_files()) .unwrap_or_exit(); @@ -290,6 +289,25 @@ impl Config { unsupported => unsupported_network(unsupported), } + let mut deprecated_options_used = false; + + if config.timestamp { + eprintln!( + "Error: `timestamp` is deprecated, timestamps on logs is (and was) always \ + enabled, please remove this option." + ); + deprecated_options_used = true; + } + + if config.verbose > 0 { + eprintln!("Error: please use `log_filters` to set logging verbosity",); + deprecated_options_used = true; + } + + if deprecated_options_used { + std::process::exit(1); + } + let daemon_dir = &config.daemon_dir; let daemon_auth = SensitiveAuth(match (config.auth, config.cookie_file) { (None, None) => Auth::CookieFile(daemon_dir.join(".cookie")), @@ -308,10 +326,6 @@ impl Config { } }); - if config.verbose > 0 { - eprintln!("Error: please use `log_filters` to set logging verbosity",); - std::process::exit(1); - } let log_filters = config.log_filters; let index_lookup_limit = match config.index_lookup_limit { @@ -354,7 +368,6 @@ impl Config { disable_electrum_rpc: config.disable_electrum_rpc, server_banner: config.server_banner, signet_magic: magic, - args: args.map(|a| a.into_string().unwrap()).collect(), }; eprintln!( "Starting electrs {} on {} {} with {:?}",