Skip to content

Commit a74c99c

Browse files
committed
less log
1 parent 00f0d72 commit a74c99c

File tree

5 files changed

+17
-4
lines changed

5 files changed

+17
-4
lines changed

.github/workflows/coverage.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ env:
3737
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=lld"
3838
FOREST_F3_SIDECAR_FFI_BUILD_OPT_OUT: 1
3939
FIL_PROOFS_PARAMETER_CACHE: /var/tmp/filecoin-proof-parameters
40+
RUST_LOG: warn
4041

4142
jobs:
4243
codecov:

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ env:
3434
CC: "sccache clang"
3535
CXX: "sccache clang++"
3636
FIL_PROOFS_PARAMETER_CACHE: /var/tmp/filecoin-proof-parameters
37+
RUST_LOG: warn
3738

3839
jobs:
3940
tests-release:

src/chain_sync/chain_follower.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -884,13 +884,18 @@ mod tests {
884884
use num_bigint::BigInt;
885885
use num_traits::ToPrimitive;
886886
use std::sync::Arc;
887+
use tracing::level_filters::LevelFilter;
888+
use tracing_subscriber::EnvFilter;
887889

888890
fn setup() -> (Arc<ChainStore<MemoryDB>>, Chain4U<Arc<MemoryDB>>) {
889891
// Initialize test logger
890892
let _ = tracing_subscriber::fmt()
893+
.without_time()
891894
.with_env_filter(
892-
tracing_subscriber::EnvFilter::from_default_env()
893-
.add_directive(tracing::Level::DEBUG.into()),
895+
EnvFilter::builder()
896+
.with_default_directive(LevelFilter::DEBUG.into())
897+
.from_env()
898+
.unwrap(),
894899
)
895900
.try_init();
896901

src/utils/rand/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ fn forest_rng_internal(mode: ForestRngMode) -> impl Rng + CryptoRng {
3535
const ENV: &str = FIXED_RNG_SEED_ENV;
3636
if let Ok(v) = std::env::var(ENV) {
3737
if let Ok(seed) = v.parse() {
38+
#[cfg(not(test))]
3839
tracing::warn!("[security] using test RNG with fixed seed {seed} set by {ENV}");
3940
return Either::Left(rand_chacha::ChaChaRng::seed_from_u64(seed));
4041
} else {

tests/lint.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,18 @@ use lints::{Lint, Violation};
4545
use proc_macro2::{LineColumn, Span};
4646
use syn::visit::Visit;
4747
use tracing::{debug, info, level_filters::LevelFilter};
48-
use tracing_subscriber::util::SubscriberInitExt as _;
48+
use tracing_subscriber::{EnvFilter, util::SubscriberInitExt as _};
4949

5050
#[test]
5151
fn lint() {
5252
let _guard = tracing_subscriber::fmt()
5353
.without_time()
54-
.with_max_level(LevelFilter::DEBUG)
54+
.with_env_filter(
55+
EnvFilter::builder()
56+
.with_default_directive(LevelFilter::DEBUG.into())
57+
.from_env()
58+
.unwrap(),
59+
)
5560
.set_default();
5661
LintRunner::new()
5762
.run::<lints::NoTestsWithReturn>()

0 commit comments

Comments
 (0)