Dzmitry Lahoda
Dzmitry Lahoda

Reputation: 939

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?

Upvotes: 0

Views: 268

Answers (2)

Russo
Russo

Reputation: 3002

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

Upvotes: 0

Dzmitry Lahoda
Dzmitry Lahoda

Reputation: 939

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();
}

Upvotes: 1

Related Questions