Revert some debug
This commit is contained in:
+2
-7
@@ -2,15 +2,13 @@ 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'
|
||||
|
||||
const BITDRIFT_API_KEY = process.env.BITDRIFT_API_KEY
|
||||
|
||||
initPromise.then(() => {
|
||||
// TODO revert
|
||||
let isEnabled = true
|
||||
let isEnabled = false
|
||||
try {
|
||||
if (Statsig.checkGate('enable_bitdrift')) {
|
||||
isEnabled = true
|
||||
@@ -19,13 +17,10 @@ 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
|
||||
// TODO gate?
|
||||
enableNetworkInstrumentation: true, // Only effects iOS, Android instrumentation is set via Gradle Plugin
|
||||
})
|
||||
} else {
|
||||
logger.info('Bitdrift is disabled')
|
||||
}
|
||||
})
|
||||
|
||||
@@ -4,6 +4,7 @@ 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'
|
||||
@@ -105,7 +106,7 @@ export function logEvent<E extends keyof LogEvents>(
|
||||
console.groupCollapsed(eventName)
|
||||
console.log(fullMetadata)
|
||||
console.groupEnd()
|
||||
logger.info(eventName, fullMetadata)
|
||||
bitdrift.info(eventName, fullMetadata)
|
||||
} catch (e) {
|
||||
// A log should never interrupt the calling code, whatever happens.
|
||||
logger.error('Failed to log an event', {message: e})
|
||||
|
||||
Reference in New Issue
Block a user