From 36a7a8d8c68fc1d3d3fd396dd9f705c966552fcb Mon Sep 17 00:00:00 2001
From: Eric Bailey <git@esb.lol>
Date: Fri, 28 Feb 2025 12:46:27 -0600
Subject: Colocate bitdrift in logger, use logger for transport (#7868)

* Colocate bitdrift in logger, use logger for transport

(cherry picked from commit cdd6941fd7f6de9829d61712340a30a55936d2ee)

* Fix mocks, format

(cherry picked from commit 9de88660c6217ebe7f83e3abfb198f85e26d9c53)

* Ok I guess mocks dir doesn't work

(cherry picked from commit 9f37e52011d2794ad8fcd732eb26558e9f0ef42c)
---
 src/lib/statsig/statsig.tsx | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

(limited to 'src/lib/statsig/statsig.tsx')

diff --git a/src/lib/statsig/statsig.tsx b/src/lib/statsig/statsig.tsx
index fb85e4356..a64c710ea 100644
--- a/src/lib/statsig/statsig.tsx
+++ b/src/lib/statsig/statsig.tsx
@@ -4,7 +4,6 @@ import {AppState, AppStateStatus} from 'react-native'
 import {Statsig, StatsigProvider} from 'statsig-react-native-expo'
 
 import {BUNDLE_DATE, BUNDLE_IDENTIFIER, IS_TESTFLIGHT} from '#/lib/app-info'
-import * as bitdrift from '#/lib/bitdrift'
 import {logger} from '#/logger'
 import {isWeb} from '#/platform/detection'
 import * as persisted from '#/state/persisted'
@@ -102,11 +101,7 @@ export function logEvent<E extends keyof LogEvents>(
     if (Statsig.initializeCalled()) {
       Statsig.logEvent(eventName, null, fullMetadata)
     }
-    // Intentionally bypass the logger abstraction to log rich objects.
-    console.groupCollapsed(eventName)
-    console.log(fullMetadata)
-    console.groupEnd()
-    bitdrift.info(eventName, fullMetadata)
+    logger.info(eventName, fullMetadata)
   } catch (e) {
     // A log should never interrupt the calling code, whatever happens.
     logger.error('Failed to log an event', {message: e})
-- 
cgit 1.4.1

