Skip to content

Commit 831ab0a

Browse files
authored
deprecate unused config option timestamp (romanz#1052)
1 parent 1b0bb23 commit 831ab0a

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

src/config.rs

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ pub struct Config {
146146
pub disable_electrum_rpc: bool,
147147
pub server_banner: String,
148148
pub signet_magic: Magic,
149-
pub args: Vec<String>,
150149
}
151150

152151
pub struct SensitiveAuth(pub Auth);
@@ -195,7 +194,7 @@ impl Config {
195194
pub fn from_args() -> Config {
196195
use internal::ResultExt;
197196

198-
let (mut config, args) =
197+
let (mut config, _args) =
199198
internal::Config::including_optional_config_files(default_config_files())
200199
.unwrap_or_exit();
201200

@@ -290,6 +289,25 @@ impl Config {
290289
unsupported => unsupported_network(unsupported),
291290
}
292291

292+
let mut deprecated_options_used = false;
293+
294+
if config.timestamp {
295+
eprintln!(
296+
"Error: `timestamp` is deprecated, timestamps on logs is (and was) always \
297+
enabled, please remove this option."
298+
);
299+
deprecated_options_used = true;
300+
}
301+
302+
if config.verbose > 0 {
303+
eprintln!("Error: please use `log_filters` to set logging verbosity",);
304+
deprecated_options_used = true;
305+
}
306+
307+
if deprecated_options_used {
308+
std::process::exit(1);
309+
}
310+
293311
let daemon_dir = &config.daemon_dir;
294312
let daemon_auth = SensitiveAuth(match (config.auth, config.cookie_file) {
295313
(None, None) => Auth::CookieFile(daemon_dir.join(".cookie")),
@@ -308,10 +326,6 @@ impl Config {
308326
}
309327
});
310328

311-
if config.verbose > 0 {
312-
eprintln!("Error: please use `log_filters` to set logging verbosity",);
313-
std::process::exit(1);
314-
}
315329
let log_filters = config.log_filters;
316330

317331
let index_lookup_limit = match config.index_lookup_limit {
@@ -354,7 +368,6 @@ impl Config {
354368
disable_electrum_rpc: config.disable_electrum_rpc,
355369
server_banner: config.server_banner,
356370
signet_magic: magic,
357-
args: args.map(|a| a.into_string().unwrap()).collect(),
358371
};
359372
eprintln!(
360373
"Starting electrs {} on {} {} with {:?}",

0 commit comments

Comments
 (0)