-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: Refactor/9083 logger class #9307
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Bitrise❌❌❌ Commit hash: d3fa3b2 Note
|
Bitrise❌❌❌ Commit hash: 687807e Note
|
E2E failure not related to this PR |
Quality Gate passedIssues Measures |
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.
LGTM!
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.
Looks good to me.
Please fill the PR description properly for ruture reference and ease of search and tracking:
- issue link
- manual testing (even if just running a unit test and checking it works)
- check boxes in checklist, just to show you considered each item
Thanks for the reminder! Updated ticket description to match just that 👍 |
Description
This PR refactors the
Logger
class'serror
method to takeError
object. While we updated the first parameter of theerror
method to be typeError
, the business logic still handles string inputs to prevent breakage (in case there are strings still being passed). Furthermore, this PR converts places where strings were being passed into theerror
method to passError
objects instead.The reason for only allowing for
Error
objects as the input is because Sentry stack traces relies on theError
object being created at the origin of the error instead of being reconstructed in theLogger
class. After these changes, we should see the correct stack trace for errors reported viaLogger
class.Related issues
Fixes: #9083
Manual testing steps
sentry.properties
file with your project valuesSENTRY_DISABLE_AUTO_UPLOAD
is "false"Logger.error
and pass inError
objectLogger.error
and pass instring
objectScreenshots/Recordings
Before
Stack trace doesn't show origin of error since
Logger.error
was passed astring
After
Stack trace shows origin of error after
Logger.error
is passed anError
objectPre-merge author checklist
Pre-merge reviewer checklist