I have a crate with production code in the src
directory and integration tests in the tests
directory. The production code uses log
macros.
I would like to init a global logger when running the integration tests (e.g. env_logger::init().unwrap();
)
There are several tests and the test order is not defined, so I don't know in which test I should put the initialize command.
Is there any way I can do this nicely? Perhaps by overriding the tests main
function?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…