-
Notifications
You must be signed in to change notification settings - Fork 31
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 #single_line_exceptions feature. #51
Conversation
I need to find a method for generating a longer exception, both for examples above and tests. Anyone have ideas? |
Here's one option to consider: https://gist.github.com/jasonrudolph/584058a67b64d89e9957 There might be a better way to accomplish this, but that approach would probably work for testing purposes. You mentioned that you're also hoping to generate long exceptions for use in examples. The approach above will probably not work for that purpose. It would produce some pretty boring examples. ;-) |
Oh, nice, I'll work that up this afternoon. |
Alright, fixed this up, need to work on tests yet: Before
Scrolls.single_line_exceptions = true
|
# Scrolls.single_line_exceptions | ||
# => true | ||
# | ||
def single_line_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.
Since this returns a Boolean, I recommend renaming it to single_line_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.
Hmm, we haven't practiced that style, but it's probably a good idea to start.
Alright, we've got tests. Going to ship a new version with this. |
Add #single_line_exceptions feature.
This adds a new feature for managing exception data in generated log messages. Default behavior is to generate a log message for each line of the backtrace, the result of which could be many lines for a single exception. To cut down on duplication and data transport this generates a single log message for the exception, joining all backtrace lines by
'\n'
.Before
After