1
0
mirror of https://github.com/romanz/electrs.git synced 2024-11-19 09:54:09 +01:00

deprecate unused config option timestamp (#1052)

This commit is contained in:
Antoni Spaanderman 2024-07-14 20:40:40 +02:00 committed by GitHub
parent 1b0bb23fab
commit 831ab0a525
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -146,7 +146,6 @@ pub struct Config {
pub disable_electrum_rpc: bool, pub disable_electrum_rpc: bool,
pub server_banner: String, pub server_banner: String,
pub signet_magic: Magic, pub signet_magic: Magic,
pub args: Vec<String>,
} }
pub struct SensitiveAuth(pub Auth); pub struct SensitiveAuth(pub Auth);
@ -195,7 +194,7 @@ impl Config {
pub fn from_args() -> Config { pub fn from_args() -> Config {
use internal::ResultExt; use internal::ResultExt;
let (mut config, args) = let (mut config, _args) =
internal::Config::including_optional_config_files(default_config_files()) internal::Config::including_optional_config_files(default_config_files())
.unwrap_or_exit(); .unwrap_or_exit();
@ -290,6 +289,25 @@ impl Config {
unsupported => unsupported_network(unsupported), 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_dir = &config.daemon_dir;
let daemon_auth = SensitiveAuth(match (config.auth, config.cookie_file) { let daemon_auth = SensitiveAuth(match (config.auth, config.cookie_file) {
(None, None) => Auth::CookieFile(daemon_dir.join(".cookie")), (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 log_filters = config.log_filters;
let index_lookup_limit = match config.index_lookup_limit { let index_lookup_limit = match config.index_lookup_limit {
@ -354,7 +368,6 @@ impl Config {
disable_electrum_rpc: config.disable_electrum_rpc, disable_electrum_rpc: config.disable_electrum_rpc,
server_banner: config.server_banner, server_banner: config.server_banner,
signet_magic: magic, signet_magic: magic,
args: args.map(|a| a.into_string().unwrap()).collect(),
}; };
eprintln!( eprintln!(
"Starting electrs {} on {} {} with {:?}", "Starting electrs {} on {} {} with {:?}",