Skip to content

Commit

Permalink
docs: independent logging setup for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
josecelano committed Dec 23, 2024
1 parent 3b173d5 commit b024575
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/test-helpers/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ pub fn ephemeral() -> Configuration {

let mut config = Configuration::default();

// This have to be Off otherwise the tracing global subscriber
// initialization will panic because you can't set a global subscriber more
// than once. You can use enable logging in tests with:
// `crate::common::logging::setup(LevelFilter::ERROR);`
// That will also allow you to capture logs and write assertions on them.
config.logging.threshold = Threshold::Off;

// Ephemeral socket address for API
Expand Down

0 comments on commit b024575

Please sign in to comment.