彩色panic信息

This commit is contained in:
HouXiaoxuan
2023-12-20 23:25:54 +08:00
parent a573ede3a6
commit 0c82e91a4b
3 changed files with 4 additions and 0 deletions

View File

@@ -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"

View File

@@ -1,4 +1,6 @@
mod cli;
fn main() {
color_backtrace::install(); // colorize backtrace
cli::handle_command();
}

View File

@@ -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);