Now, drush reports on only messages of type error. Lets add all the other messages to the log.

CommentFileSizeAuthor
#5 drush.inc-messages.patch364 bytesthebuckst0p

Comments

moshe weitzman’s picture

any objection?

greg.1.anderson’s picture

Seems like a good idea to me. The fact that they are not logged is currently kind of mysterious. Logging them all seems more appropriate (principal of least astonishment...)

moshe weitzman’s picture

Status: Active » Fixed

Committed this. I don't think this will log excessively but feel free to reopen if you think so.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

thebuckst0p’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new364 bytes

Hi Moshe,
The _drush_print_log() callback to _drush_log_drupal_messages() (as far as I can tell, the best way to turn regular messages into drush messages for drush batch scripts) doesn't include the "status" message type in its output, but that's the default for drupal_set_message().
The attached patch adds 'status' to the switch().

Thanks,
Ben

moshe weitzman’s picture

Status: Needs review » Postponed (maintainer needs more info)

Regular 'status' messages fall through to the 'default' case and are always printed. You think this is undesireable?

thebuckst0p’s picture

That's weird, it didn't output at all for me and I had --verbose on. Let me try again...

thebuckst0p’s picture

So here's my [test] script:

// we want messages at the end
drush_set_context('DRUSH_VERBOSE', TRUE);

drupal_set_message("test", 'status');

// output messages as drush messages
_drush_log_drupal_messages();

I run it with drush php-script SCRIPT and it normally outputs nothing. When I add the 'status' patch it outputs "test" as it should.
So it looks like the default message requires 'debug' to be on, not just verbose. Debug has a lot of extraneous [debugging] output that isn't a "message" per se. I guess it seems that messages should either always output or should output in verbose. My use case was batch-scripting PathAuto which has its own drupal_set_message notices that I wanted to be visible in my script; anything similar calling standard Drupal APIs would probably be the same way.
It's not a huge deal, I can patch it or turn on debugging for my own use case, I was just surprised.

Thanks,
Ben

moshe weitzman’s picture

Status: Postponed (maintainer needs more info) » Fixed

right you are. committed. hopefully this doesn't clutter the output of verbose too badly.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.