11import { addBreadcrumb , captureException } from '@sentry/core' ;
2- import type { SeverityLevel } from '@sentry/types' ;
2+ import type { ConsoleLevel , SeverityLevel } from '@sentry/types' ;
33import { logger as coreLogger } from '@sentry/utils' ;
44
55import { DEBUG_BUILD } from '../debug-build' ;
66
7- const CONSOLE_LEVELS = [ 'info' , 'warn' , 'error' , 'log' ] as const ;
7+ type ReplayConsoleLevels = Extract < ConsoleLevel , 'info' | 'warn' | 'error' | 'log' > ;
8+ const CONSOLE_LEVELS : readonly ReplayConsoleLevels [ ] = [ 'info' , 'warn' , 'error' , 'log' ] as const ;
89
910type LoggerMethod = ( ...args : unknown [ ] ) => void ;
1011type LoggerConsoleMethods = Record < 'info' | 'warn' | 'error' | 'log' , LoggerMethod > ;
@@ -15,11 +16,11 @@ interface ReplayLogger extends LoggerConsoleMethods {
1516 * Calls `logger.info` but saves breadcrumb in the next tick due to race
1617 * conditions before replay is initialized.
1718 */
18- infoTick ( ... args : unknown [ ] ) : void ;
19+ infoTick : LoggerMethod ;
1920 /**
2021 * Captures exceptions (`Error`) if "capture internal exceptions" is enabled
2122 */
22- exception ( error : unknown ) : void ;
23+ exception : LoggerMethod ;
2324 enableCaptureInternalExceptions ( ) : void ;
2425 disableCaptureInternalExceptions ( ) : void ;
2526 enableTraceInternals ( ) : void ;
0 commit comments