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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProgressBar.println prints to stderr as default #310

Closed
silvioprog opened this issue Sep 14, 2021 · 2 comments
Closed

ProgressBar.println prints to stderr as default #310

silvioprog opened this issue Sep 14, 2021 · 2 comments

Comments

@silvioprog
Copy link

The smallest project to reproduce:

use indicatif::ProgressBar;

fn main() {
    let pb = ProgressBar::new_spinner();
    pb.println("Calculating...");
}
cargo build
./target/debug/app > msg.txt # Empty content 馃檨
./target/debug/app 2> msg.txt # Filled content 馃檪

Is this a bug or a behavior by design? (anyway, I solved in my project "temporary" using ProgressDrawTarget::stdout())

cheers

@djc
Copy link
Collaborator

djc commented Sep 15, 2021

Yes, I think this is by design. As I understand it, status information on the currently running command is usually printed to stderr, so that stdout can be used to print output data from the command (which can then conveniently be piped into a file).

@djc
Copy link
Collaborator

djc commented Feb 22, 2022

Going to close this, feel free to reopen if you still think there is an issue.

@djc djc closed this as completed Feb 22, 2022
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

No branches or pull requests

2 participants