-
Notifications
You must be signed in to change notification settings - Fork 26
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
Fix TypeError when exc_info=False #42
Conversation
Formatting of a message fails in the `StdlibFormatter` when the `exc_info` parameter is `False`. The traceback shows that handling of the boolean is not done correct in the formatting for error type and message. ```python Traceback (most recent call last): File "lib/python3.8/logging/__init__.py", line 1081, in emit msg = self.format(record) File "lib/python3.8/logging/__init__.py", line 925, in format return fmt.format(record) File "ecs_logging/_stdlib.py", line 117, in format result = self.format_to_ecs(record) File "ecs_logging/_stdlib.py", line 163, in format_to_ecs value = extractors[field](record) File "ecs_logging/_stdlib.py", line 150, in <lambda> if (r.exc_info is not None and r.exc_info[0] is not None) TypeError: 'bool' object is not subscriptable ``` This replaces the lambda with methods handling `exc_info` being an boolean or iterable.
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪 |
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 this. Here's some comments for you, going to tag in other reviewers.
jenkins test this please |
jenkins test this please |
Formatting of a message fails in the
StdlibFormatter
when theexc_info
parameter isFalse
. The traceback shows that handling ofthe boolean is not done correct in the formatting for error type and
message.
This replaces the lambda with methods handling
exc_info
being anboolean or iterable.