Skip to content

Commit fa387a7

Browse files
committed
ensure that intercept console log option works
1 parent 054ac98 commit fa387a7

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/shared/InitializeOptions.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable no-undef */
2-
import { VueRay } from './VueRay';
2+
import { ray, VueRay } from './VueRay';
33
import errorHandler from './ErrorHandler';
44

55
export const initializeOptions = (options: any, vueConfig: any) => {
@@ -53,6 +53,20 @@ export const initializeOptions = (options: any, vueConfig: any) => {
5353
VueRay.show_component_lifecycles = options.showComponentEvents;
5454
}
5555

56+
if (typeof nodeRaySettings['interceptConsoleLog'] !== 'undefined') {
57+
try {
58+
if (nodeRaySettings['interceptConsoleLog'] == true) {
59+
// @ts-ignore
60+
ray().interceptor().enable();
61+
} else {
62+
// @ts-ignore
63+
ray().interceptor().disable();
64+
}
65+
} catch (err) {
66+
console.error('failed to enable console.log interception:', err);
67+
}
68+
}
69+
5670
VueRay.useDefaultSettings({
5771
host,
5872
port,

0 commit comments

Comments
 (0)