Skip to content

Commit 911df09

Browse files
committed
graph, node: Switch from deprecated isatty to atty
1 parent 6d16a16 commit 911df09

File tree

5 files changed

+29
-27
lines changed

5 files changed

+29
-27
lines changed

Cargo.lock

Lines changed: 23 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

graph/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ diesel_derives = { workspace = true }
2525
chrono = "0.4.41"
2626
envconfig = "0.11.0"
2727
Inflector = "0.11.3"
28-
isatty = "0.1.9"
28+
atty = "0.2"
2929
reqwest = { version = "0.12.15", features = ["json", "stream", "multipart"] }
3030
ethabi = "17.2"
3131
hex = "0.4.3"

graph/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ pub mod prelude {
7878
pub use ::anyhow;
7979
pub use anyhow::{anyhow, Context as _, Error};
8080
pub use async_trait::async_trait;
81+
pub use atty;
8182
pub use chrono;
8283
pub use diesel;
8384
pub use envconfig;
8485
pub use ethabi;
8586
pub use hex;
86-
pub use isatty;
8787
pub use lazy_static::lazy_static;
8888
pub use prost;
8989
pub use rand;

graph/src/log/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ macro_rules! impl_slog_value {
1717
};
1818
}
1919

20-
use isatty;
20+
use atty;
2121
use slog::*;
2222
use slog_async;
2323
use slog_envlogger;
@@ -36,7 +36,7 @@ pub fn logger(show_debug: bool) -> Logger {
3636
}
3737

3838
pub fn logger_with_levels(show_debug: bool, levels: Option<&str>) -> Logger {
39-
let use_color = isatty::stdout_isatty();
39+
let use_color = atty::is(atty::Stream::Stdout);
4040
let decorator = slog_term::TermDecorator::new().build();
4141
let drain = CustomFormat::new(decorator, use_color).fuse();
4242
let drain = slog_envlogger::LogBuilder::new(drain)

node/src/manager/color.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::{io, sync::Mutex};
22
use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor};
33

4-
use graph::prelude::{isatty, lazy_static};
4+
use graph::prelude::{atty, lazy_static};
55

66
use super::CmdResult;
77

@@ -21,7 +21,7 @@ impl Terminal {
2121
"always" => ColorChoice::Always,
2222
"ansi" => ColorChoice::AlwaysAnsi,
2323
"auto" => {
24-
if isatty::stdout_isatty() {
24+
if atty::is(atty::Stream::Stdout) {
2525
ColorChoice::Auto
2626
} else {
2727
ColorChoice::Never

0 commit comments

Comments
 (0)