Skip to content
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

Drush log levels #2115

Closed
greg-1-anderson opened this issue Apr 1, 2016 · 1 comment
Closed

Drush log levels #2115

greg-1-anderson opened this issue Apr 1, 2016 · 1 comment
Milestone

Comments

@greg-1-anderson
Copy link
Member

When I added a PSR-3 logger to Robo, the existing code was printing most progress text via a 'printTaskInfo()' function. I decided to map that to LogLevel::NOTICE, and adjusted things so that notices were printed by Robo. Seems to work out to me; WARNING is a different level entirely (more severe), and, while the kinds of things Robo was printing via printTaskInfo was interesting to the commandline user, it seemed that a non-verbose log (e.g. on a server) might just omit these.

Drush sort of had this problem too; we solved the problem of log messages that were not WARNING level, but should be printed all the time by introducing OK and SUCCESS log levels. The difference between these were always somewhat ambiguous, and the problem remains that there are still some messages we might want to print that are not necessarily "OK" or "SUCCESS". Also, NOTICE is a standard PSR-3 / rfc5424 log level, whereas OK and SUCCESS are not.

When I implemented the core-init command as an annotation command with Robo tasks, I bumped NOTICE up so that it would print all the time; however, this introduced a lot of extra noise that we normally did not see, as Drush currently expects that NOTICE logs are only displayed in verbose mode. My plan is to change all of the existing NOTICE logs to INFO. Currently, Drush core has 13 logs that are emitted at NOTICE, and 4 that are emitted at INFO.

The technical difference between NOTICE and INFO are minimal; the RFC is not really clear about what log levels should be displayed or filtered under what conditions; I think the assumption is that this is decided by the application, and it seems to be further assumed that the application selects the minimum log level to show by selecting one of the defined log levels -- there is no standard mapping from verbose to NOTICE or greater, etc. -- although most implementations seem to omit NOTICE unless verbose.

I'd like to continue to display NOTICE at normal (non-verbose) output, and demote existing NOTICE logs to INFO (which is only displayed with VERBOSE output).

@greg-1-anderson
Copy link
Member Author

Done in 720034e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant