Skip to content

Commit

Permalink
Merge pull request #1811 from subspace/support-no-color-output
Browse files Browse the repository at this point in the history
Support output without colors
  • Loading branch information
nazar-pc authored Aug 14, 2023
2 parents 8597b0a + 37db587 commit 2695aed
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
17 changes: 17 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions crates/subspace-farmer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ subspace-networking = { version = "0.1.0", path = "../subspace-networking" }
subspace-proof-of-space = { version = "0.1.0", path = "../subspace-proof-of-space", features = ["chia"] }
subspace-rpc-primitives = { version = "0.1.0", path = "../subspace-rpc-primitives" }
substrate-bip39 = "0.4.4"
supports-color = "2.0.0"
tempfile = "3.4.0"
thiserror = "1.0.38"
tokio = { version = "1.28.2", features = ["macros", "parking_lot", "rt-multi-thread", "signal"] }
Expand Down
13 changes: 8 additions & 5 deletions crates/subspace-farmer/src/bin/subspace-farmer/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,14 @@ struct Command {
async fn main() -> anyhow::Result<()> {
tracing_subscriber::registry()
.with(
fmt::layer().with_filter(
EnvFilter::builder()
.with_default_directive(LevelFilter::INFO.into())
.from_env_lossy(),
),
fmt::layer()
// TODO: Workaround for https://github.com/tokio-rs/tracing/issues/2214
.with_ansi(supports_color::on(supports_color::Stream::Stderr).is_some())
.with_filter(
EnvFilter::builder()
.with_default_directive(LevelFilter::INFO.into())
.from_env_lossy(),
),
)
.init();
utils::raise_fd_limit();
Expand Down

0 comments on commit 2695aed

Please sign in to comment.