-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Default to stderr for the console helpers (2.7+) #15795
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
Conversation
@@ -89,6 +94,10 @@ public function run(OutputInterface $output, $cmd, $error = null, $callback = nu | |||
*/ | |||
public function mustRun(OutputInterface $output, $cmd, $error = null, $callback = null) | |||
{ | |||
if ($output instanceof ConsoleOutputInterface) { | |||
$output = $output->getErrorOutput(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is useless as it is covered by run()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct. Let me adjust that quickly.
👍 Status: Reviewed |
Thank you @alcohol. |
… (alcohol) This PR was merged into the 2.7 branch. Discussion ---------- [Console] Default to stderr for the console helpers (2.7+) Interactive input/output and informational output such as progress should go to `stderr` if available. | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Only merge if #15794 is merged. If someone explicitly wants to use `stdout`, they can simply pass `$output->getStream()` instead of `$output` in most use-cases. Commits ------- 90c2a96 Default to stderr for console helpers (only merge if #15794 gets merged)
Whats the reasoning for this? Broke a lot of bash scripts with progress bars... |
Interactive input/output and informational output such as progress should go to
stderr
if available.Only merge if #15794 is merged.
If someone explicitly wants to use
stdout
, they can simply pass$output->getStream()
instead of$output
in most use-cases.