'How to see logs out of tests running Substrate Cumulus based runtime?

I have test. It runs full runtime. I sure there are logs along the stack. But I cannot see them in output.

I run test like that:

RUST_LOG=trace,parity-db=error,trie=error,runtime=trace,substrate-relay=trace,bridge=trace cargo ltest my_runtime::xcm_test -- --nocapture

What should I do to see logs in tests?



Solution 1:[1]

substrate uses usual next logger

/// this must be singleton
#[cfg(test)]
pub fn env_logger_init() {
    let _ = env_logger::builder().is_test(true).try_init();
}

Solution 2:[2]

println!("Hello world {:#?} {:?}", who, balance);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Russo