Skip to content

feat(ndk): Forward enable_logs option to sentry-native - #1971

Merged
romtsn merged 3 commits into
masterfrom
roman/forward-enable-logs-ndk
Aug 11, 2026
Merged

feat(ndk): Forward enable_logs option to sentry-native#1971
romtsn merged 3 commits into
masterfrom
roman/forward-enable-logs-ndk

Conversation

@romtsn

@romtsn romtsn commented Aug 10, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds enableLogs field (+ setter/getter) to NdkOptions
  • Wires sentry_options_set_enable_logs() in the JNI initSentryNative bridge

This allows the Android SDK to forward SentryOptions.Logs.isEnabled() to the native layer, unblocking sentry_log_*() calls from native code on Android.

Ref: getsentry/sentry-java#5911

Test plan

  • Verify native logs reach Sentry when logs.enabled = true in SentryAndroidOptions
  • Verify native logs are still dropped when logs.enabled = false (default)

🤖 Generated with Claude Code

Add `enableLogs` field to `NdkOptions` and wire it through the JNI
bridge so the Android SDK can forward the user's logs configuration
to the native layer.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 1aaba14

Comment thread ndk/lib/src/main/jni/sentry.c
romtsn and others added 2 commits August 10, 2026 14:20
@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.18%. Comparing base (a12dd91) to head (1aaba14).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1971      +/-   ##
==========================================
+ Coverage   76.15%   76.18%   +0.03%     
==========================================
  Files          94       94              
  Lines       22216    22216              
  Branches     3941     3941              
==========================================
+ Hits        16919    16926       +7     
+ Misses       4411     4395      -16     
- Partials      886      895       +9     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@romtsn
romtsn merged commit 8789d64 into master Aug 11, 2026
66 checks passed
@romtsn
romtsn deleted the roman/forward-enable-logs-ndk branch August 11, 2026 08:26
@jpnurmi

jpnurmi commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

There's an ongoing effort to remove enable_logs and enable_metrics altogether in all SDKs. 😅 I guess this won't be needed, after all?

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.

3 participants