feat(macros) add panic_with_log

This commit is contained in:
lumither committed 2024-11-19 00:33:09 -08:00
1 parent a123ff9f3f
commit c7e3b12856
7 files changed
+74 -64

No files matched your search

+4 -3
View File
@@ -1,3 +1,6 @@
use macros::panic_with_log;
use tracing::Level;
mod blog;
mod init;
mod logger;
@@ -9,12 +12,10 @@ async fn main() {
init::load_env();
let _guards = init::logger_init();
// panic!("test");
match server::start().await {
Ok(_) => {}
Err(e) => {
panic!("server start failed: {}", e);
panic_with_log!(Level::ERROR, "failed to start server: {}", e);
}
};
}