Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We hard code a WATCHDOG_ERROR severity for all php errors, including notices. Attached patch maps error levels to our watchdog severity levels and calls watchdog with the right severity. This will lighten the load for all poor souls responsible for monitoring errors in watchdog. It also silences drush a bit.
Comment | File | Size | Author |
---|---|---|---|
#5 | severity-exception-notice.patch | 535 bytes | asimmonds |
#2 | severity.diff | 3.62 KB | moshe weitzman |
severity.diff | 3.62 KB | moshe weitzman | |
Comments
Comment #1
webchickMoshe tells me that this will stop drush installsite from outputting scary errors. It also seems like a decent improvement, in any case.
The first line should be /** instead of /*, or else the docs won't show up on api.drupal.org.
Also, for maximum pedanticness, the first line of the description should be <= 80 chars, with everything else on the following.
E_STRICT are the least error-y of all of them, so I'd make this one WATCHDOG_NOTICE, personally.
"Enable to have PHP suggest changes to your code which will ensure the best interoperability and forward compatibility of your code."
Debug? Not notice? If using debug here means "Not at all important in the grand scheme of things", then probably E_STRICT should be debug as well.
Powered by Dreditor.
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commentedNice catch on E_STRICT. i made that 'debug' severity as well. Doxygen as well.
Comment #3
moshe weitzman CreditAttribution: moshe weitzman commentedImplemented all suggestions by webchick, so lets push it back to her.
Comment #4
webchickCool, thanks!
Committed to HEAD.
Comment #5
asimmonds CreditAttribution: asimmonds commentedSmall problem with the committed patch, if a uncaught exception occurs (ie a PDOException), you will get a notice of:
Attached patch hardcodes exceptions to WATCHDOG_ERROR
Comment #6
moshe weitzman CreditAttribution: moshe weitzman commentedgood catch
Comment #7
webchickNice, thanks. Committed to HEAD.