rust - How to initialize the logger for integration tests? -
i have crate production code in src
directory , integration tests in tests
directory. production code uses log
macros.
i init global logger when running integration tests (e.g. env_logger::init().unwrap();
) there several tests , test order not defined, don't know in test should put initialize command.
is there way can nicely? perhaps overriding tests main
function?
there's no way kind of thing built-in right now.
you can write macro inserts sort of initialization call before each test, that's close there is.
Comments
Post a Comment