-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
Error log improvements: Provide priority level #14995
Conversation
(Standard links)
|
@mfb I think I merged the other b4 cutting the rc - I tried just switching this over to be with it but looks like I need you to rebase some commits out |
Well... can you remove #14222 from the RC? because I think it needs more work - there is some problem re: high or possibly infinite memory usage. |
@mfb ah ok - do you want to put up a revert commit for it against the rc? Then we can re-open this including that against master |
Revert PR @ #14996 |
I've switched this back to master now that the revert has happened |
@pfigel any chance you can review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick fix @mfb, LGTM!
- General standards
- Developer standards
@@ -962,7 +964,7 @@ public static function exceptionHandler($pearError) { | |||
* $obj | |||
*/ | |||
public static function nullHandler($obj) { | |||
CRM_Core_Error::debug_log_message("Ignoring exception thrown by nullHandler: {$obj->code}, {$obj->message}"); | |||
CRM_Core_Error::debug_log_message("Ignoring exception thrown by nullHandler: {$obj->code}, {$obj->message}", FALSE, '', PEAR_LOG_ERR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been inconclusively bike-shedding on whether this should be PEAR_LOG_DEBUG
or PEAR_LOG_ERR
, but I don't think it matters much, so I'm good unless anyone has a strong opinion on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These definitely may be legitimate errors that administrators may need to take action to correct.
If there is truly debug-level info being sent to the nullhandler, then some logic to sort that out from the errors could be a nice further improvement.
thanks @pfigel - no strong opinion on the err name -n merging |
Overview
CRM_Core_Error::debug_var()
should have a$priority
argument so that we can assign a priority level to fatal errors and other usages ofCRM_Core_Error::debug_var()
. This is a reattempt at a lighter-weight version of #14222.Before
A call like
CRM_Core_Error::debug_var('Fatal Error Details', ...)
logs at the default severity level.After
CRM_Core_Error::debug_var()
has an optional$priority
arg.