-
Notifications
You must be signed in to change notification settings - Fork 2.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
Expand exception stack trace in log in debug mode #5478
Conversation
Test passed. |
$message = $ex->getMessage(); | ||
if ($ex->getCode()) { | ||
$message .= ' [' . $message . ']'; | ||
} |
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.
Why the brackets if the code is truthy?
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.
It's supposed to output $ex->getCode() in brackets.
Will fix.
good idea 👍 |
And tested. This is really useful 👍 |
if ($ex->getCode()) { | ||
$message .= ' [' . $message . ']'; | ||
} | ||
\OCP\Util::writeLog('index', $message, \OCP\Util::FATAL); |
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.
Just to be explicit, maybe make it \OCP\Util::writeLog('index', 'Exception: ' . $message, \OCP\Util::FATAL);
Test passed. |
I'm not really sure this should be in the public namespace. If so, it should take an |
Makes sense. I've added the $app parameter. |
Test passed. |
👍 from my side. Since this is an addition to the public API I'd like another reviewer though. |
👍 |
Expand exception stack trace in log in debug mode
Log exception stack trace in debug mode instead of just the message.
Based on the discussion in #5273
Please review @karlitschek @DeepDiver1975 @tanghus