From 0c82e91a4b1e2cfac55b0d968ecb9460da21d27b Mon Sep 17 00:00:00 2001 From: HouXiaoxuan Date: Wed, 20 Dec 2023 23:25:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=A9=E8=89=B2panic=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.toml | 1 + src/main.rs | 2 ++ src/utils/util.rs | 1 + 3 files changed, 4 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 5a9f4d3..5345149 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,3 +14,4 @@ serde = { version = "1.0.193", features = ["derive"] } serde_json = "1.0.108" colored = "2.1.0" rand = "0.8.5" +color-backtrace = "0.6.1" diff --git a/src/main.rs b/src/main.rs index fa88689..1156d39 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,6 @@ mod cli; fn main() { + color_backtrace::install(); // colorize backtrace + cli::handle_command(); } diff --git a/src/utils/util.rs b/src/utils/util.rs index 028c816..d2e2af5 100644 --- a/src/utils/util.rs +++ b/src/utils/util.rs @@ -6,6 +6,7 @@ pub const ROOT_DIR: &str = ".mit"; pub const TEST_DIR: &str = "mit_test_storage"; // 执行测试的储存库 fn setup_test_dir() { + color_backtrace::install(); // colorize backtrace let path = std::env::var("CARGO_MANIFEST_DIR").unwrap(); //获取项目根目录定位 let mut path = PathBuf::from(path); path.push(TEST_DIR);