fix(logger): support exception and exception_name fields at any log level#1930
fix(logger): support exception and exception_name fields at any log level#1930leandrodamascena merged 3 commits intoaws-powertools:developfrom
Conversation
|
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
tests/functional/test_logger.py
Outdated
| ) | ||
|
|
||
| # WHEN log level info | ||
| logger.info("log") |
There was a problem hiding this comment.
Suggestion: add the exception fields here so it's easier to scan and understand what's being tested.
logger.info("log", exception=..., exception_name=...)
Codecov ReportBase: 97.44% // Head: 97.45% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #1930 +/- ##
========================================
Coverage 97.44% 97.45%
========================================
Files 144 144
Lines 6627 6629 +2
Branches 475 475
========================================
+ Hits 6458 6460 +2
Misses 132 132
Partials 37 37
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
|
Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience! |
Issue number: #1923
Summary
Providing fix for reporting entry logs with custom exception and exception_name fields
Changes
Changed format log to honor
exceptionandexception_namefieldsUser experience
given:
before:
{ "level": "INFO", "message": "Report" }after:
{ "level": "INFO", "message": "Report", "exception": "Oops! That was not valid", "exception_name": "ValueError", }Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
noAcknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.