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