-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
STDERR instead of STDOUT for default drush output #707
Comments
+1 |
Only the output format system prints to STDOUT. All the other junk is On Thu, Jul 3, 2014 at 11:37 AM, Jeremy Simkins [email protected]
|
Mmh, thanks. "dww" commented it the right way 5 years ago:
It seems the change happened to all the debugging output regardless if it's an error or not. It's rather odd that Drush prints a [success] message to STDERR. In drush.inc the log entry is parsed and several "message levels" are defined: warning, cancel, failed, error, ok, completed, success, status, notice, message and info. I think only "warning", "cancel", "failed" and "error" should go to STDERR, everyting else belongs to STDOUT. Any thoughts why it should stay the wrong way? |
[[[[I disagree, 'ok' or 'success' are not errors but they are just status outputs not generally the data you actually requested. Whatever comes through |
By Design |
I don't get it. How do I get notified of errors during cron? It seems my option is to suppress all output, including the useful errors. I can't suppress "[notice] WD cron: Cron run completed." with --quiet anymore, and it's going to stderr so I can't just trash stdout. |
I used to think STDERR was for all errors - it's right there in the name, even! I later noticed many commands that log most information to STDERR while sending the program output to STDOUT. Reading about STDERR on wikipedia:
In modern drush, if you want to send something to STDOUT you can do it a few ways, but a solid method is:
|
Thanks for this thread! Just spent an hour trying to figure out why my pipe to grep test command to detect new PHP ERRORs are introduced in CI wasn't working and finally realized all drush output is sent to STDERR, this thread was really useful in confirming this after we realized the issue! e.g. drush watchdog:show --type=php --severity=warning | grep "No log messages" I expected it to return a 0 but since the return value of This works but is/was confusing to me as I had no reason to suspect this would go to STDERR: |
Hi there,
is there any reason why Drush by default outputs all messages to STDERR even if no errors happen, like when I do a simple cache-clear?
We usually use Drush in our deploy scripts with Capistrano, and all the drush output is displayed in red color because of that. Of course we could change the deploy recipes to always redirect STDERR to STDOUT, but... why?
Thanks for clearing this up.
The text was updated successfully, but these errors were encountered: