Temp debug

This commit is contained in:
Eric Bailey
2025-02-12 16:10:37 -06:00
parent d79000eabc
commit 09d933469b
2 changed files with 5 additions and 2 deletions
+4
View File
@@ -2,6 +2,7 @@ import {init, SessionStrategy} from '@bitdrift/react-native'
import {Statsig} from 'statsig-react-native-expo'
import {initPromise} from '#/lib/statsig/statsig'
import {logger} from '#/logger'
export {debug, error, info, warn} from '@bitdrift/react-native'
@@ -18,10 +19,13 @@ initPromise.then(() => {
// Statsig may complain about it being called too early.
}
if (isEnabled && BITDRIFT_API_KEY) {
logger.info('Bitdrift is enabled')
init(BITDRIFT_API_KEY, SessionStrategy.Activity, {
url: 'https://api-bsky.bitdrift.io',
// TODO gate
enableNetworkInstrumentation: true, // Only effects iOS, Android instrumentation is set via Gradle Plugin
})
} else {
logger.info('Bitdrift is disabled')
}
})
+1 -2
View File
@@ -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'
@@ -106,7 +105,7 @@ export function logEvent<E extends keyof LogEvents>(
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})