Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Console] default to stderr if available#13730
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
kingcrunch commentedFeb 18, 2015
I'd like to disagree, because that aren't errors. "Bug fix? Yes" -- which one? 😕 |
alcohol commentedFeb 18, 2015
|
kingcrunch commentedFeb 18, 2015
Primary I don't understand, what this PR solves. If you want to redirect the output you are usually not interested in a progress bar and interaction at all and so I'd expect Also I think that some tools (in my opinion) misuse [1] For example |
dzuelke commentedFeb 19, 2015
Take this for instance: cURL will now (correctly) prompt for the password on The Unix philosophy where you have specialized, simple command line tools is about building pipelines. You can only build pipelines if your |
pjcdawkins commentedMay 8, 2015
What about Should there also be |
alcohol commentedMay 26, 2015
While it might be convenient, I do think it should be up to the user to use the proper output (stdout vs. stderr) when calling |
jenkoian commentedMay 26, 2015
Chris Fidao explains this quite well alsohttp://fideloper.com/laravel-symfony-console-commands-stderr |
alcohol commentedMay 26, 2015
Thanks, nice link :-). |
Seldaek commentedMay 26, 2015
👍 |
Tobion commentedMay 26, 2015
I wouldn't change this in 2.3 but only in 2.7/2.8 as it might have side effects. Also in later version there are alot more classes that would need to be adjusted as well like the ProgressBar class to be consistent. Also I feel this is the developers task to pass the correct output to these classes. It's not the responsibility of the classes to magically use a different output. It goes against the single responsibility principle. |
alcohol commentedMay 26, 2015
Aye, there is something to be said for that as well. I think it would help convention if stderr was the default, but it would certainly be nice if this could still be switched out for stdout instead. Not sure how to resolve that approach properly though. Thoughts? |
Tobion commentedSep 14, 2015
Many people do not know the history of unix file descriptors and best practices, so it is not clear that stderr should be used for informational messages. Considering that, we might want to reconsider this PR. @Seldaek what do you think? |
Seldaek commentedSep 14, 2015
@Tobion well, IMO there are literally no reasons to ever write a question or interactive thing on STDOUT, so I don't really see it as a problem either way to default to the right thing (STDERR), and yes if you really want to force it to be STDOUT you can still do it as you say. |
Tobion commentedSep 14, 2015
@alcohol can you create a new PR please? |
alcohol commentedSep 14, 2015
With the same approach? (sorry I was not following the latest additions to the discussion) |
Seldaek commentedSep 14, 2015
This one could just be reopened/merged no? |
Tobion commentedSep 14, 2015
Yes same approach. Cannot be reopened because repo was deleted. |
alcohol commentedSep 14, 2015
I don't have my fork anymore. So no... |
lyrixx commentedSep 14, 2015
https://patch-diff.githubusercontent.com/raw/symfony/symfony/pull/13730.patch should ease the work ;) |
alcohol commentedSep 14, 2015
Do you still want me to base this off of 2.3 though? |
This PR was squashed before being merged into the 2.3 branch (closes#15794).Discussion----------[Console] default to stderr in the console helpersInteractive 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 |See#13730 also for previous discussion.If someone explicitly wants to use `stdout`, they can simply pass `$output->getStream()` instead of `$output` in most use-cases.Commits-------3d4e95e [Console] default to stderr in the console helpers
[Console]
Interactive input/output and informational output such as progress should go to
stderrif available./cc@Seldaek@dzuelke