Skip to content
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

Handle loguru msg levels that are not supported by Sentry #4147

Merged
merged 4 commits into from
Mar 19, 2025

Conversation

antonpirker
Copy link
Member

Loguru has two message levels TRACE and SUCCESS that are not available in Sentry breadcrumbs. This PR maps TRACE to debug and SUCCESS to info in Sentry so those breadcrumbs do not show a confusing error message in the Sentry UI.

Fixes #2759

Verified

This commit was signed with the committer’s verified signature.
sentrivana Ivana Kellyer
@antonpirker antonpirker requested a review from sentrivana March 18, 2025 10:34
Copy link

codecov bot commented Mar 18, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 4 lines in your changes missing coverage. Please review.

Project coverage is 79.50%. Comparing base (bc54a1d) to head (4601407).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
sentry_sdk/integrations/loguru.py 66.66% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4147      +/-   ##
==========================================
- Coverage   79.57%   79.50%   -0.08%     
==========================================
  Files         141      141              
  Lines       15714    15723       +9     
  Branches     2671     2673       +2     
==========================================
- Hits        12505    12501       -4     
- Misses       2367     2377      +10     
- Partials      842      845       +3     
Files with missing lines Coverage Δ
sentry_sdk/integrations/loguru.py 88.13% <66.66%> (-1.87%) ⬇️

... and 7 files with indirect coverage changes

Copy link
Contributor

@sentrivana sentrivana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok, but the tests need fixing.

Verified

This commit was signed with the committer’s verified signature.
sentrivana Ivana Kellyer
@antonpirker antonpirker merged commit 11abdd2 into master Mar 19, 2025
139 of 140 checks passed
@antonpirker antonpirker deleted the antonpirker/fix/loguru-levels branch March 19, 2025 07:48
@andyshinn
Copy link

Thanks for eventually getting to this! I know it's small but I always appreciate when I don't need to see weird warnings staring back at me in the UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sentry doesn't support loguru level=trace
3 participants