Skip to content

feat(loguru): Make Logs the primary feature - #7255

Open
sentrivana wants to merge 3 commits into
major/3.0from
ivana/major/loguru-integration-changes
Open

feat(loguru): Make Logs the primary feature#7255
sentrivana wants to merge 3 commits into
major/3.0from
ivana/major/loguru-integration-changes

Conversation

@sentrivana

@sentrivana sentrivana commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Description

Get the Loguru integration into shape now that Sentry Logs is a first-class feature. The idea is to make Logs the primary feature the integration offers, with capturing events an optional add-on.

High-level overview of the changes:

  • The integration has to be enabled explicitly by the user. It's not auto-enabled anymore.
  • Sentry logs related options and features get more generic sounding names.
    • For instance, level (before: sentry_logs_level) now sets the Sentry logs level.
    • Existing secondary features with previously generic names get specialized names (level -> breadcrumb_level).
  • Capturing Sentry logs is on by default when the integration is enabled.
  • Event capture is off by default, but can be turned on via an option. Breadcrumb capture is still on by default.
  • The capture_sentry_logs option is gone completely. Since logs instrumentation is now on by default, and the level option exists, it was superfluous. Capturing logs can still be opted out of by setting level=None.

Issues

Closes #7247
Closes https://linear.app/getsentry/issue/PY-2740/update-loguru-integration

@sentrivana
sentrivana marked this pull request as ready for review August 26, 2026 11:32
@sentrivana
sentrivana requested a review from a team as a code owner August 26, 2026 11:32

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d8739b3. Configure here.

Comment thread tests/integrations/loguru/test_loguru.py
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

110495 passed | ⏭️ 5428 skipped | Total: 115923 | Pass Rate: 95.32% | Execution Time: 384m 12s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -8478
Passed Tests 📉 -7172
Failed Tests 📉 -2
Skipped Tests 📉 -1304

➖ Removed Tests (2)

View removed tests
  • test_continuous_profiler_auto_start_and_stop_sampled[non-experiment-gevent]
    • File: tests.profiler.test_continuous_profiler
  • test_continuous_profiler_auto_start_and_stop_sampled_span_streaming[experiment-gevent]
    • File: tests.profiler.test_continuous_profiler

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2268 uncovered lines.
✅ Project coverage is 90.51%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
sentry_sdk/integrations/loguru.py 100.00% ⚠️ 1 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    90.22%    90.51%    +0.29%
==========================================
  Files          193       185        -8
  Lines        25435     23904     -1531
  Branches      9346      8806      -540
==========================================
+ Hits         22947     21636     -1311
- Misses        2488      2268      -220
- Partials      1434      1378       -56

Generated by Codecov Action

@sentrivana sentrivana changed the title chore(loguru): Clean up integration chore(loguru): Make Logs the primary feature Aug 26, 2026
@linear-code

linear-code Bot commented Aug 26, 2026

Copy link
Copy Markdown

PY-2740

@sentrivana sentrivana changed the title chore(loguru): Make Logs the primary feature feat(loguru): Make Logs the primary feature Aug 26, 2026
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.

2 participants