#[macro_use]
extern crate log;
fn whatever() {
info!("whatever")
}
#[test]
fn test() {
whatever();
}
I want to see the log after running unit tests (cargo test),
how is it possible now?
#[macro_use]
extern crate log;
fn whatever() {
info!("whatever")
}
#[test]
fn test() {
whatever();
}
I want to see the log after running unit tests (cargo test),
how is it possible now?
The log crate doesn't do any logging by itself. From the main documentation page:
If no logging implementation is selected, the facade falls back to a "noop" implementation that ignores all log messages.
For your logging messages to go anywhere, you have to initialize a particular logging implementation, such as env_logger. However, it seems that right now, there is no way to perform initialization before tests are run.