google/comprehensive-rust

[Exercise][13. Methods and Traits] Better output of example solution

Closed this issue · 3 comments

In Section13.4, there's an exercise code section to write a VerbosityFilter of a Logger; however, the logger uses eprintln! macro to output the log, which output to stderr. Therefore, the run result in the website shows only No output.

Should we consider logging out messages from both stdout and stderr?

Comparison
In Rust Playground:

=====Standard Error=====
   Compiling playground v0.0.1 (/playground)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.54s
     Running `target/debug/playground`
verbosity=2: Uhoh
=====Standard Output====

In Comprehensive Rust:

No output

Probably easiest to just change eprintln to println? Do you want to make up a PR?

Hi @djmitche, just noticed #531, probably we can revert this change after #531 is fixed.

Thanks for spotting that! I think the change is fine with or without that fix.