From 30093d3a9f80a31a4d656f984aa155adf082e521 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Tue, 5 Jan 2021 20:39:05 +0900 Subject: [PATCH] Initialize Rocket early to initialize logger early --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 0ab55ec3..d61f57b4 100755 --- a/src/main.rs +++ b/src/main.rs @@ -82,6 +82,8 @@ and https://docs.joinplu.me/installation/init for more info. "#, ) .get_matches(); + // Initialize Rocket early to load its internal logger + let rocket = rocket::custom(CONFIG.rocket.clone().unwrap()); let dbpool = init_pool().expect("main: database pool initialization error"); if IMPORTED_MIGRATIONS .is_pending(&dbpool.get().unwrap()) @@ -175,7 +177,7 @@ Then try to restart Plume println!("Please refer to the documentation to see how to configure it."); } - let rocket = rocket::custom(CONFIG.rocket.clone().unwrap()) + let rocket = rocket .mount( "/", routes![