Skip to content

Commit fb6ca14

Browse files
committed
fix circular dependency
1 parent 39f404d commit fb6ca14

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/utils/src/instrument.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type {
1111

1212
import { isString } from './is';
1313
import type { ConsoleLevel } from './logger';
14-
import { CONSOLE_LEVELS, logger } from './logger';
14+
import { CONSOLE_LEVELS, logger, originalConsoleMethods } from './logger';
1515
import { fill } from './object';
1616
import { getFunctionName } from './stacktrace';
1717
import { supportsHistory, supportsNativeFetch } from './supports';
@@ -123,11 +123,6 @@ function triggerHandlers(type: InstrumentHandlerType, data: any): void {
123123
}
124124
}
125125

126-
/** Only exported for testing & debugging. */
127-
export const originalConsoleMethods: {
128-
[key in ConsoleLevel]?: (...args: any[]) => void;
129-
} = {};
130-
131126
/** JSDoc */
132127
function instrumentConsole(): void {
133128
if (!('console' in GLOBAL_OBJ)) {

packages/utils/src/logger.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { originalConsoleMethods } from './instrument';
21
import { GLOBAL_OBJ } from './worldwide';
32

43
/** Prefix for logging strings */
@@ -10,6 +9,12 @@ export type ConsoleLevel = (typeof CONSOLE_LEVELS)[number];
109
type LoggerMethod = (...args: unknown[]) => void;
1110
type LoggerConsoleMethods = Record<ConsoleLevel, LoggerMethod>;
1211

12+
/** This may be mutated by the console instrumentation. */
13+
export const originalConsoleMethods: {
14+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
15+
[key in ConsoleLevel]?: (...args: any[]) => void;
16+
} = {};
17+
1318
/** JSDoc */
1419
interface Logger extends LoggerConsoleMethods {
1520
disable(): void;

0 commit comments

Comments
 (0)