Skip to content

Commit

Permalink
init_tracing_with_ansi()
Browse files Browse the repository at this point in the history
  • Loading branch information
czy-29 committed Aug 28, 2024
1 parent 2ee1128 commit 1aaebce
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/bin/next.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!")),
Expand Down

0 comments on commit 1aaebce

Please sign in to comment.