Skip to content

[messenger] log ConsumeMessagesCommand informational notices to stdout instead of stderr #42327

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

Closed
maryo opened this issue Jul 30, 2021 · 2 comments

Comments

@maryo
Copy link
Contributor

maryo commented Jul 30, 2021

Not sure if it's a bug, a feature request or just a question. Probably something in between. Why does ConsumeMessagesCommand use stderr instead of stdout for messages like Consuming messages from transport... introduced in #29303? I know i can disable the messages entirely using -q. Wouldn't stdout be more appropriate? Thank you.

@chalasr
Copy link
Member

chalasr commented Jul 30, 2021

Stdout is about regular, processable output (as in reusable for further processing). It's usually the result of the command.
Any additional/exceptional output such as notices, errors, logs... should go to stderr.

Also, while the core command might not output anything useful to stdout, the command might be extended in userland. Hence we prefer outputting everything to stderr in that case.

@maryo
Copy link
Contributor Author

maryo commented Jul 30, 2021

I always considered stderr suitable only for errors / warning / exceptions. I am surprised but looks like Symfony's approach is quite common after more googling. I should have googled more before asking here. Sorry and thank you.

@maryo maryo closed this as completed Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants