-
-
Notifications
You must be signed in to change notification settings - Fork 475
feat(android): [Logs and Metrics Enable Flags 4] Add Timber Logs opt-in #5943
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/logs-opt-in-jul
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -473,7 +473,7 @@ static void installDefaultIntegrations( | |
| } | ||
|
|
||
| if (isTimberAvailable) { | ||
| options.addIntegration(new SentryTimberIntegration()); | ||
| options.addIntegration(new SentryTimberIntegration(options.isEnableTimberLogs())); | ||
|
Comment on lines
475
to
+476
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Suggested FixThe Prompt for AI AgentAlso affects:
Did we get this right? 馃憤 / 馃憥 to inform future reviews. |
||
| } | ||
| options.addIntegration(new AppComponentsBreadcrumbsIntegration(context)); | ||
| options.addIntegration(new SystemEventsBreadcrumbsIntegration(context)); | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -71,6 +71,9 @@ public final class SentryAndroidOptions extends SentryOptions { | |||||
| /** Enable or disable automatic breadcrumbs for Network Events Using NetworkCallback */ | ||||||
| private boolean enableNetworkEventBreadcrumbs = true; | ||||||
|
|
||||||
| /** Enable or disable automatic Sentry Logs capture from Timber. Default is disabled. */ | ||||||
| private boolean enableTimberLogs = false; | ||||||
|
|
||||||
| /** | ||||||
| * Enables the Auto instrumentation for Activity lifecycle tracing. | ||||||
| * | ||||||
|
|
@@ -457,6 +460,14 @@ public void setEnableNetworkEventBreadcrumbs(boolean enableNetworkEventBreadcrum | |||||
| this.enableNetworkEventBreadcrumbs = enableNetworkEventBreadcrumbs; | ||||||
| } | ||||||
|
|
||||||
| public boolean isEnableTimberLogs() { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what do you think about naming this IMO, the current API isn't clear if we are outputting to Timber or capturing from Timber.
Suggested change
|
||||||
| return enableTimberLogs; | ||||||
| } | ||||||
|
|
||||||
| public void setEnableTimberLogs(boolean enableTimberLogs) { | ||||||
| this.enableTimberLogs = enableTimberLogs; | ||||||
| } | ||||||
|
|
||||||
| /** | ||||||
| * Enable or disable all the automatic breadcrumbs | ||||||
| * | ||||||
|
|
||||||
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.
Timber logs option ignored at init
High Severity
Auto-installed
SentryTimberIntegrationcopiesisEnableTimberLogsin its constructor duringinstallDefaultIntegrations, which runs before theSentryAndroid.initconfiguration callback. SettingenableTimberLogsin that callback therefore never reaches the plantedSentryTimberTree, so the Java/Kotlin opt-in silently has no effect. Manifest metadata still works because it is applied earlier.Additional Locations (1)
sentry-android-timber/src/main/java/io/sentry/android/timber/SentryTimberIntegration.kt#L49-L50Reviewed by Cursor Bugbot for commit 4f677fb. Configure here.
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.
fixed in a later PR