-
Notifications
You must be signed in to change notification settings - Fork 264
Could log output be shown in tests? #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This seems like more of a rust-lang/rust issue than this crate - |
@sfackler Thanks for clarifying! I think I got confused by the documentation. |
Posting for reference: After some digging, I found a report of this already at rust-lang/rust#40298 |
Leaving this for google results. A decent work around:
|
563: Print log to stdout in test r=Dirbaio a=deantvv Use simple [trick](rust-lang/log#106) to allow print log to stdout in test Co-authored-by: Dean Li <deantvv@gmail.com> Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
On windows, but also use templating to render it correctly everywhere. Fixes rust-lang#106 Fixes rust-lang#111
For people searching and finding this issue: Add in each test, instead of
Then, to cargo toml
Finally, set env variable to desired debugging level: |
Normally running tests mutes standard output, but using this rather obscure command
cargo test -- --nocapture
, output such asprintln!("something");
is shown in the test result.This is great for debugging. However, it doesn't appear to work with the log macros.
I found #56 which documents how to enable output in tests specifically, but I am wondering if there is some easier way?
The text was updated successfully, but these errors were encountered: