get rid of dumb import structure
This commit is contained in:
@@ -83,7 +83,7 @@ function createLogger(
|
||||
warn: logger.warn.bind(logger),
|
||||
error: logger.error.bind(logger),
|
||||
useChild: (context: Exclude<Logger['context'], undefined>) => {
|
||||
return useMemo(() => createLogger(context, metadata), [context, metadata])
|
||||
return useMemo(() => createLogger(context, metadata), [context])
|
||||
},
|
||||
Context: Logger.Context,
|
||||
}
|
||||
|
||||
@@ -5,14 +5,12 @@ const mockSpan = {
|
||||
end: jest.fn(),
|
||||
}
|
||||
|
||||
jest.mock('#/logger/sentry/lib', () => ({
|
||||
Sentry: {
|
||||
startInactiveSpan: jest.fn(() => mockSpan),
|
||||
},
|
||||
jest.mock('@sentry/react-native', () => ({
|
||||
startInactiveSpan: jest.fn(() => mockSpan),
|
||||
}))
|
||||
|
||||
const {Sentry}: {Sentry: {startInactiveSpan: jest.Mock}} = jest.requireMock(
|
||||
'#/logger/sentry/lib',
|
||||
const Sentry: {startInactiveSpan: jest.Mock} = jest.requireMock(
|
||||
'@sentry/react-native',
|
||||
)
|
||||
|
||||
describe('createPlaybackTelemetry', () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {Sentry} from '#/logger/sentry/lib'
|
||||
import * as Sentry from '@sentry/react-native'
|
||||
|
||||
/**
|
||||
* Where the video is being played.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import {Platform} from 'react-native'
|
||||
import {type ImagePickerAsset} from 'expo-image-picker'
|
||||
import * as Sentry from '@sentry/react-native'
|
||||
import {nanoid} from 'nanoid/non-secure'
|
||||
|
||||
import {
|
||||
type ProbedMetadata,
|
||||
type VideoCompressSkipReason,
|
||||
} from '#/lib/media/video/types'
|
||||
import {Sentry} from '#/logger/sentry/lib'
|
||||
import {type Metrics} from '#/analytics/metrics'
|
||||
|
||||
type MetricFn = <E extends keyof Metrics>(event: E, payload: Metrics[E]) => void
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as Sentry from '@sentry/react-native'
|
||||
import slugify from 'slugify'
|
||||
|
||||
import {getEntries} from '#/logger/logDump'
|
||||
import {Sentry} from '#/logger/sentry/lib'
|
||||
|
||||
export function sendErrorReport({
|
||||
title,
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export * as Sentry from '@sentry/react-native'
|
||||
@@ -1 +0,0 @@
|
||||
export * as Sentry from '@sentry/react-native'
|
||||
@@ -1,8 +1,8 @@
|
||||
import {getGlobalScope, init} from '@sentry/react-native'
|
||||
import * as Sentry from '@sentry/react-native'
|
||||
|
||||
import * as env from '#/env'
|
||||
|
||||
init({
|
||||
Sentry.init({
|
||||
enabled: !env.IS_DEV && !!env.SENTRY_DSN,
|
||||
enableAutoSessionTracking: false,
|
||||
dsn: env.SENTRY_DSN,
|
||||
@@ -42,7 +42,7 @@ init({
|
||||
* Events already carry react_native_context.fabric, but a tag is easier to
|
||||
* filter and dashboard on. Detection matches the SDK's own isFabricEnabled.
|
||||
*/
|
||||
getGlobalScope().setTag(
|
||||
Sentry.getGlobalScope().setTag(
|
||||
'new_arch',
|
||||
(global as {nativeFabricUIManager?: unknown}).nativeFabricUIManager != null,
|
||||
)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import * as Sentry from '@sentry/react-native'
|
||||
|
||||
import {isNetworkError} from '#/lib/strings/errors'
|
||||
import {Sentry} from '#/logger/sentry/lib'
|
||||
import {LogLevel, type Transport} from '#/logger/types'
|
||||
import {prepareMetadata} from '#/logger/util'
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ import {useState} from 'react'
|
||||
import {View} from 'react-native'
|
||||
import {plural} from '@lingui/core/macro'
|
||||
import {Trans, useLingui} from '@lingui/react/macro'
|
||||
import * as Sentry from '@sentry/react-native'
|
||||
import {useMutation} from '@tanstack/react-query'
|
||||
|
||||
import {logger} from '#/logger'
|
||||
import {Sentry} from '#/logger/sentry/lib'
|
||||
import {atoms as a, useTheme, web} from '#/alf'
|
||||
import {Button, ButtonText} from '#/components/Button'
|
||||
import * as Dialog from '#/components/Dialog'
|
||||
|
||||
Reference in New Issue
Block a user