From 1aaebced8690a09006cab4f47f7786ac2aab20cd Mon Sep 17 00:00:00 2001 From: 29 <791603901@qq.com> Date: Thu, 29 Aug 2024 00:23:08 +0800 Subject: [PATCH] `init_tracing_with_ansi()` https://github.com/tokio-rs/tracing/issues/3068 --- src/bin/next.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/bin/next.rs b/src/bin/next.rs index 9e0247f..3603a1d 100644 --- a/src/bin/next.rs +++ b/src/bin/next.rs @@ -55,11 +55,16 @@ fn init_tracing() { .init(); } -#[tokio::main] -async fn main() -> Result<(), anyhow::Error> { +// 参见:https://github.com/tokio-rs/tracing/issues/3068 +fn init_tracing_with_ansi() { #[cfg(windows)] nu_ansi_term::enable_ansi_support().ok(); init_tracing(); +} + +#[tokio::main] +async fn main() -> Result<(), anyhow::Error> { + init_tracing_with_ansi(); match Op::init() { _ => Err(anyhow::anyhow!("暂时todo!")),