Skip to content
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

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

Closed
Alx-Lai opened this issue Sep 29, 2024 · 3 comments · Fixed by #2383
Closed

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

Alx-Lai opened this issue Sep 29, 2024 · 3 comments · Fixed by #2383

Comments

@Alx-Lai
Copy link
Collaborator

Alx-Lai commented Sep 29, 2024

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
@djmitche
Copy link
Collaborator

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

djmitche pushed a commit that referenced this issue Sep 30, 2024
In this exercise, the original StderrLogger output to stderr, which user
cannot see the original log but "No output" in frontend". Change
`eprintln!` to `println!` to make it see-able in the frontend. Also, due
to the change, rename the logger struct.

Close: #2382

Signed-off-by: Alx-Lai <[email protected]>
@Alx-Lai
Copy link
Collaborator Author

Alx-Lai commented Sep 30, 2024

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

@djmitche
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants