Skip to content

Commit 7c9d6da

Browse files
committed
fix: emit migration warning before tracing subscriber is initialised
Config::load fires before init_logging in the normal serve path, so the tracing::warn! in load_json_and_migrate was silently dropped - the subscriber didn't exist yet. Fix by calling init_logging("warn") before Config::load so the migration notice is visible. The second init_logging call with config.log_level is a harmless no-op (try_init semantics); RUST_LOG is still respected because EnvFilter checks the env var first, and "warn" is already the compiled default for log_level anyway this adds no overhead, the subscriber is registered once; the second call is a no-op.
1 parent d44c2fd commit 7c9d6da

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ async fn main() -> ExitCode {
201201
}
202202

203203
let config_path = mhrv_rs::data_dir::resolve_config_path(args.config_path.as_deref());
204+
init_logging("warn"); // boot-time logging so migration warning is visible
204205
let config = match Config::load(&config_path) {
205206
Ok(c) => c,
206207
Err(e) => {

0 commit comments

Comments
 (0)