-
Notifications
You must be signed in to change notification settings - Fork 15
Masked the exc_info output in exception log tracebacks #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
Conversation
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.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
maskerlogger/masker_formatter.py
Outdated
| # Mask sensitive data in the formatted exception string | ||
| if found_matching_regex := self.regex_matcher.match_regex_to_line(formatted): | ||
| return self._mask_secret(formatted, found_matching_regex) | ||
| return formatted |
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.
Bug: Missing timeout exception handling in formatException
The formatException method in MaskerFormatterJson lacks error handling for TimeoutException. When regex_matcher.match_regex_to_line or _mask_secret encounters a timeout, the exception propagates uncaught, potentially crashing the logging process. This is inconsistent with _mask_sensitive_data which wraps similar operations in a try-except block to handle timeouts gracefully.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #26 +/- ##
==========================================
- Coverage 92.65% 91.66% -0.99%
==========================================
Files 4 4
Lines 177 192 +15
==========================================
+ Hits 164 176 +12
- Misses 13 16 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This reverts commit 8037ad9.
Description
Related Issue
Fixes #
Type of Change
Changes Made
Testing
Manual Testing Steps
Checklist
Screenshots (if applicable)
Additional Context
Note
Masks sensitive data in exception tracebacks for both text and JSON formatters, adds tests, and bumps version to 1.1.1.
AbstractMaskedLogger._mask_sensitive_datato maskrecord.msg,record.exc_text, and fallback to maskingexc_info(traceback) by populatingrecord.exc_text.MaskerFormatterJson.formatExceptionto mask secrets in serialized exceptions.MaskerFormatter) and JSON (MaskerFormatterJson) outputs.1.1.1inmaskerlogger/__init__.pyandpyproject.toml.Written by Cursor Bugbot for commit 98e4f22. This will update automatically on new commits. Configure here.