Skip to content

Commit

Permalink
fix: ansi_term is unmaintained RUSTSEC-2021-0139
Browse files Browse the repository at this point in the history
fixes #143

remove ansi terminal colors temporarily until `tracing-subscriber` backports `nu-ansi-style`
refs: tokio-rs/tracing#2287
  • Loading branch information
joseluisq committed Sep 25, 2022
1 parent 82caf15 commit 76fd7ea
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 31 deletions.
38 changes: 14 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -56,7 +56,7 @@ tokio-rustls = { version = "0.23" }
tokio-util = { version = "0.7", default-features = false, features = ["io"] }
toml = "0.5"
tracing = { version = "0.1", default-features = false, features = ["std"] }
tracing-subscriber = { version = "0.3", default-features = false, features = ["smallvec", "parking_lot", "fmt", "ansi", "tracing-log"] }
tracing-subscriber = { version = "0.3", default-features = false, features = ["smallvec", "parking_lot", "fmt", "tracing-log"] }

[target.'cfg(all(target_env = "musl", target_pointer_width = "64"))'.dependencies.tikv-jemallocator]
version = "0.5"
Expand Down
6 changes: 0 additions & 6 deletions src/logger.rs
Expand Up @@ -18,16 +18,10 @@ pub fn init(log_level: &str) -> Result {
fn configure(level: &str) -> Result {
let level = level.parse::<Level>()?;

#[cfg(unix)]
let enable_ansi = true;
#[cfg(windows)]
let enable_ansi = false;

match tracing_subscriber::fmt()
.with_writer(std::io::stderr)
.with_max_level(level)
.with_span_events(FmtSpan::CLOSE)
.with_ansi(enable_ansi)
.try_init()
{
Err(err) => Err(anyhow!(err)),
Expand Down

0 comments on commit 76fd7ea

Please sign in to comment.