I figured that in order to dump log into a file the following works:
let decorator = slog_term::PlainDecorator::new(file); let drain = slog_term::FullFormat::new(decorator).build().filter_level(slog::Level::Debug).fuse(); let drain = slog_async::Async::new(drain).build().fuse();
The issue I’m facing is that if a test is failing (specifically, panic!s), then the log file appears to be incomplete.
If it wasn’t a #[test], I believe the workaround would be somewhere along the lines https://github.com/slog-rs/slog/issues/118, but I’m not sure how to make it work in case of tests.
Any advice? Is there a better practice for using slog in tests?