Skip to content

Commit 701d3ca

Browse files
committed
tweak types
1 parent bfc5570 commit 701d3ca

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/replay-internal/src/util/logger.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { addBreadcrumb, captureException } from '@sentry/core';
2-
import type { SeverityLevel } from '@sentry/types';
2+
import type { ConsoleLevel, SeverityLevel } from '@sentry/types';
33
import { logger as coreLogger } from '@sentry/utils';
44

55
import { 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

910
type LoggerMethod = (...args: unknown[]) => void;
1011
type 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

Comments
 (0)