Skip to content

Commit

Permalink
fix: log to stderr, only color if no tty
Browse files Browse the repository at this point in the history
Closes #87.
  • Loading branch information
conorsch committed Jun 5, 2024
1 parent 515c8d6 commit 66466a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/tracing.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
use std::io::IsTerminal as _;
use tracing_subscriber::{prelude::*, EnvFilter};

/// Initializes a tracing subscriber.
pub(crate) fn init_subscriber() -> anyhow::Result<()> {
let fmt_layer = tracing_subscriber::fmt::layer().with_target(true);
let fmt_layer = tracing_subscriber::fmt::layer()
.with_target(true)
.with_ansi(std::io::stderr().is_terminal())
.with_writer(std::io::stderr);
let filter_layer = EnvFilter::try_from_default_env()
.or_else(|_| EnvFilter::try_new("info"))?
// Force disabling of r1cs log messages, otherwise the `ark-groth16` crate
Expand Down

0 comments on commit 66466a7

Please sign in to comment.