diff --git a/swap/src/api.rs b/swap/src/api.rs index ca3ae21d..6940b8b1 100644 --- a/swap/src/api.rs +++ b/swap/src/api.rs @@ -184,6 +184,10 @@ impl Context { let data_dir = data::data_dir_from(data, is_testnet)?; let env_config = env_config_from(is_testnet); + START.call_once(|| { + let _ = cli::tracing::init(debug, json, data_dir.join("logs")); + }); + let seed = Seed::from_file_or_generate(data_dir.as_path()) .context("Failed to read seed in file")?; @@ -219,10 +223,6 @@ impl Context { let tor_socks5_port = tor.map_or(9050, |tor| tor.tor_socks5_port); - START.call_once(|| { - let _ = cli::tracing::init(debug, json, data_dir.join("logs")); - }); - let context = Context { db: open_db(data_dir.join("sqlite")).await?, bitcoin_wallet,