Skip to content

Commit 286f16f

Browse files
committed
fix
1 parent 545ba8b commit 286f16f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/addons/consoleCatcher.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,13 @@ const createConsoleCatcher = (): {
6363
const oldFunction = window.console[method].bind(window.console);
6464

6565
window.console[method] = function (...args: unknown[]): void {
66-
const stack =
67-
new Error().stack?.split('\n').slice(2).join('\n') || '';
66+
const stack = new Error().stack?.split('\n').slice(2).join('\n') || '';
6867

6968
const logEvent: ConsoleLogEvent = {
7069
method,
7170
timestamp: new Date(),
7271
type: method,
73-
message: args
74-
.map((arg) => typeof arg === 'string' ? arg : JSON.stringify(arg)).join(' '),
72+
message: args.map((arg) => typeof arg === 'string' ? arg : JSON.stringify(arg)).join(' '),
7573
stack,
7674
fileLine: stack.split('\n')[0]?.trim(),
7775
};
@@ -84,6 +82,7 @@ const createConsoleCatcher = (): {
8482

8583
addErrorEvent(event: ErrorEvent | PromiseRejectionEvent): void {
8684
const logEvent = createConsoleEventFromError(event);
85+
8786
addToConsoleOutput(logEvent);
8887
},
8988

@@ -94,5 +93,4 @@ const createConsoleCatcher = (): {
9493
};
9594

9695
const consoleCatcher = createConsoleCatcher();
97-
export const { initConsoleCatcher, getConsoleLogStack, addErrorEvent } =
98-
consoleCatcher;
96+
export const { initConsoleCatcher, getConsoleLogStack, addErrorEvent } = consoleCatcher;

0 commit comments

Comments
 (0)