Initialize Rocket early to initialize logger early

This commit is contained in:
Kitaiti Makoto 2021-01-05 20:39:05 +09:00
parent 29f2239e3f
commit 30093d3a9f

View File

@ -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![