Unit testing 运行“货物测试”时记录日志`

Unit testing 运行“货物测试”时记录日志`,unit-testing,testing,logging,rust,rust-cargo,Unit Testing,Testing,Logging,Rust,Rust Cargo,我想在运行单元测试(cargo test)后查看日志, 现在怎么可能呢?这个日志板条箱本身不做任何日志记录。发件人: 如果未选择任何日志实现,facade将返回到忽略所有日志消息的“noop”实现 为了让日志消息到处传播,必须初始化特定的日志实现,例如。然而,现在看来,.没有任何解决办法吗?D: #[macro_use] extern crate log; fn whatever() { info!("whatever") } #[test] fn test() { what

我想在运行单元测试(
cargo test
)后查看日志,
现在怎么可能呢?

这个
日志
板条箱本身不做任何日志记录。发件人:

如果未选择任何日志实现,facade将返回到忽略所有日志消息的“noop”实现


为了让日志消息到处传播,必须初始化特定的日志实现,例如。然而,现在看来,.

没有任何解决办法吗?D:
#[macro_use]
extern crate log;

fn whatever() {
    info!("whatever")
}

#[test]
fn test() {
    whatever();
}