diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a1f89d..260d40f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,10 +21,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - logger: use `/` as a delimiter between an actor's group and key ([#74]). - core/addr: expose the `addr` module. - core: generate `NodeNo` randomly if not provided. -- network: don't force `safe-*` features of lz4_flex ([#136]). +- network: don't force `safe-*` features of the `lz4_flex` crate ([#136]). ### Fixed - core: update the `idr-ebr` crate to v0.3 to fix possible crash in `Context::finished()`. +- logger: replace the `atty` crate with `IsTerminal` to fix cargo-audit warnings. [#74]: https://github.com/elfo-rs/elfo/issues/74 [#135]: https://github.com/elfo-rs/elfo/pull/135 diff --git a/elfo-logger/Cargo.toml b/elfo-logger/Cargo.toml index b777254..bc4a90d 100644 --- a/elfo-logger/Cargo.toml +++ b/elfo-logger/Cargo.toml @@ -28,7 +28,6 @@ tokio = { workspace = true, features = ["macros", "fs", "io-util"] } arc-swap = "1.2.0" once_cell = { version = "1.8.0", features = ["parking_lot"] } futures-intrusive = "0.5" -atty = "0.2.14" serde = { version = "1.0.120", features = ["derive"] } parking_lot = "0.12" sharded-slab = "0.1.7" diff --git a/elfo-logger/src/actor.rs b/elfo-logger/src/actor.rs index cf47e37..c9b87e8 100644 --- a/elfo-logger/src/actor.rs +++ b/elfo-logger/src/actor.rs @@ -1,4 +1,8 @@ -use std::{sync::Arc, time::Duration}; +use std::{ + io::{self, IsTerminal as _}, + sync::Arc, + time::Duration, +}; use metrics::increment_counter; use tokio::{ @@ -226,7 +230,7 @@ async fn open_file(config: &Config) -> Option { } fn can_use_colors(config: &Config) -> bool { - config.sink == Sink::Stdout && atty::is(atty::Stream::Stdout) + config.sink == Sink::Stdout && io::stdout().is_terminal() } fn extract_location(metadata: &Metadata<'static>) -> Option<(&'static str, u32)> {