Skip to content

Commit

Permalink
use env-filter so we can control logging using standard RUST_LOG sema…
Browse files Browse the repository at this point in the history
…ntics
  • Loading branch information
xoloki committed Oct 3, 2023
1 parent a44fb0b commit 747a358
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ serde = { version = "1.0", features = ["derive"] }
sha2 = "0.10"
thiserror = "1.0"
tracing = "0.1.37"
tracing-subscriber = "0.3.17"
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }

[dev-dependencies]
criterion = "0.5.1"
Expand Down
7 changes: 4 additions & 3 deletions src/state_machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,7 @@ mod test {
use p256k1::{ecdsa, point::Point, scalar::Scalar};
use rand_core::{CryptoRng, OsRng, RngCore};
use std::sync::atomic::{AtomicBool, Ordering};
use tracing_subscriber::{fmt, prelude::*, EnvFilter};

use crate::{
common::PolyCommitment,
Expand Down Expand Up @@ -1525,9 +1526,9 @@ mod test {
) -> (Coordinator<Aggregator>, Vec<SigningRound<Signer>>) {
unsafe {
match LOG_INIT.compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst) {
Ok(false) => tracing_subscriber::fmt()
.with_max_level(tracing::Level::WARN)
.with_target(true)
Ok(false) => tracing_subscriber::registry()
.with(fmt::layer())
.with(EnvFilter::from_default_env())
.init(),
_ => {}
}
Expand Down

0 comments on commit 747a358

Please sign in to comment.