From 506cba254cbde1986e0eab984cae9675caa54369 Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Wed, 17 Dec 2025 10:20:32 -0600 Subject: [PATCH] refactor(analytics): Only plant DebugTree in debug builds (#4025) Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com> --- .../core/analytics/platform/GooglePlatformAnalytics.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/analytics/src/google/kotlin/org/meshtastic/core/analytics/platform/GooglePlatformAnalytics.kt b/core/analytics/src/google/kotlin/org/meshtastic/core/analytics/platform/GooglePlatformAnalytics.kt index ab62aa723..412fed033 100644 --- a/core/analytics/src/google/kotlin/org/meshtastic/core/analytics/platform/GooglePlatformAnalytics.kt +++ b/core/analytics/src/google/kotlin/org/meshtastic/core/analytics/platform/GooglePlatformAnalytics.kt @@ -102,7 +102,15 @@ constructor( .setBundleWithTraceEnabled(true) .setBundleWithRumEnabled(true) .build() - Timber.plant(DatadogTree(datadogLogger), CrashlyticsTree(), DebugTree()) + buildList { + add(DatadogTree(datadogLogger)) + add(CrashlyticsTree()) + if (BuildConfig.DEBUG) { + add(DebugTree()) + } + } + .forEach(Timber::plant) + // Initial consent state updateAnalyticsConsent(analyticsPrefs.analyticsAllowed)