Skip to content

Commit

Permalink
deprecate unused config option timestamp (#1052)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonilol committed Jul 14, 2024
1 parent 1b0bb23 commit 831ab0a
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ pub struct Config {
pub disable_electrum_rpc: bool,
pub server_banner: String,
pub signet_magic: Magic,
pub args: Vec<String>,
}

pub struct SensitiveAuth(pub Auth);
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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")),
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {:?}",
Expand Down

0 comments on commit 831ab0a

Please sign in to comment.