iroh_test::logging

Function setup

Source
pub fn setup() -> DefaultGuard
Expand description

Configures logging for the current test, single-threaded runtime only.

This setup can be used for any sync test or async test using a single-threaded tokio runtime (the default).

This configures logging that will interact well with tests: logs will be captured by the test framework and only printed on failure.

The logging is unfiltered, it logs all crates and modules on TRACE level. If that’s too much consider if your test is too large (or write a version that allows filtering…).

§Example

#[tokio::test]
async fn test_something() {
    let _guard = iroh_test::logging::setup();
    assert!(true);
}