Skip to content

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

Merged
antonpirker merged 4 commits into
masterfrom
antonpirker/fix/loguru-levels
Mar 19, 2025
Merged

Handle loguru msg levels that are not supported by Sentry#4147
antonpirker merged 4 commits into
masterfrom
antonpirker/fix/loguru-levels

Conversation

@antonpirker

Copy link
Copy Markdown
Contributor

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

@antonpirker
antonpirker requested a review from sentrivana March 18, 2025 10:34
@codecov

codecov Bot commented Mar 18, 2025

Copy link
Copy Markdown

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

@sentrivana sentrivana left a comment

Copy link
Copy Markdown
Contributor

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.

@antonpirker
antonpirker merged commit 11abdd2 into master Mar 19, 2025
@antonpirker
antonpirker deleted the antonpirker/fix/loguru-levels branch March 19, 2025 07:48
@andyshinn

Copy link
Copy Markdown

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