Another try with Sentry

This commit is contained in:
Zhiyuan Zheng 2021-01-22 02:21:13 +01:00
parent e820ce3690
commit 08df036289
No known key found for this signature in database
GPG Key ID: 078A93AB607D85E0
2 changed files with 14 additions and 7 deletions

11
App.tsx
View File

@ -1,13 +1,14 @@
import { ActionSheetProvider } from '@expo/react-native-action-sheet' import { ActionSheetProvider } from '@expo/react-native-action-sheet'
import Index from '@root/Index' import Index from '@root/Index'
import dev from '@root/startup/dev' import dev from '@root/startup/dev'
import sentry from '@root/startup/sentry' // import sentry from '@root/startup/sentry'
import log from '@root/startup/log' import log from '@root/startup/log'
import audio from '@root/startup/audio' import audio from '@root/startup/audio'
import onlineStatus from '@root/startup/onlineStatus' import onlineStatus from '@root/startup/onlineStatus'
import netInfo from '@root/startup/netInfo' import netInfo from '@root/startup/netInfo'
import { persistor, store } from '@root/store' import { persistor, store } from '@root/store'
import ThemeManager from '@utils/styles/ThemeManager' import ThemeManager from '@utils/styles/ThemeManager'
import Constants from 'expo-constants'
import * as SplashScreen from 'expo-splash-screen' import * as SplashScreen from 'expo-splash-screen'
import React, { useCallback, useEffect, useState } from 'react' import React, { useCallback, useEffect, useState } from 'react'
import { enableScreens } from 'react-native-screens' import { enableScreens } from 'react-native-screens'
@ -15,13 +16,19 @@ import { QueryClient, QueryClientProvider } from 'react-query'
import { Provider } from 'react-redux' import { Provider } from 'react-redux'
import { PersistGate } from 'redux-persist/integration/react' import { PersistGate } from 'redux-persist/integration/react'
import { LogBox, Platform } from 'react-native' import { LogBox, Platform } from 'react-native'
import * as Sentry from 'sentry-expo'
if (Platform.OS === 'android') { if (Platform.OS === 'android') {
LogBox.ignoreLogs(['Setting a timer for a long period of time']) LogBox.ignoreLogs(['Setting a timer for a long period of time'])
} }
log('log', 'Sentry', 'initializing')
Sentry.init({
dsn: Constants.manifest.extra.sentryDSN
})
dev() dev()
sentry() // sentry()
audio() audio()
onlineStatus() onlineStatus()

View File

@ -4,11 +4,11 @@ import log from './log'
const sentry = () => { const sentry = () => {
log('log', 'Sentry', 'initializing') log('log', 'Sentry', 'initializing')
// return Sentry.init({ return Sentry.init({
// dsn: Constants.manifest.extra.sentryDSN, dsn: Constants.manifest.extra.sentryDSN,
// enableInExpoDevelopment: false, enableInExpoDevelopment: false,
// debug: __DEV__ debug: __DEV__
// }) })
} }
export default sentry export default sentry