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
add previous exception messages to plain text output #609
Conversation
Can be disabled via `PlainTextHandler::addPreviousToOutput(false)` and adds lines between the exception and the trace containing the exception and line of creator. The method `Inspector::getFrames()` already appends all frames from the previous exceptions. So there is no need in adding the trace for each previous exception. IMO the test tests something that it should not test: the output of the line number. But that should be in a separate PR. I've at least added constants for the line numbers so that you only have to change them once for all tests.
I just realized how phpunit outputs the trace - they have some more line breaks:
The trace for later exceptions is just a subset of the last but dividing the output with a line break and the Caused by keyword makes it easy to find specific exceptions with What do you think? |
Go for it. |
bce5c5f
to
400cb5c
Compare
400cb5c
to
54bf2df
Compare
/** | ||
* @var bool | ||
*/ | ||
private $addPreviousToOutput = true; |
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 do we need this switch? Do you know a case where we dont want the previous exceptions?
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.
maybe someone don't want it in the logs. or they show it to the client and want to hide it there (for example the message could contain internal information that should only be visible to developers).
Thank you for your contribution! |
fixes #608
Can be disabled via
PlainTextHandler::addPreviousToOutput(false)
andadds lines between the exception and the trace containing the exception
and line of creator.
The method
Inspector::getFrames()
already appends all frames from theprevious exceptions. So there is no need in adding the trace for each
previous exception.
IMO the test tests something that it should not test: the output of the
line number. But that should be in a separate PR. I've at least added
constants for the line numbers so that you only have to change them once
for all tests.