22
ANSI_STYLE_DIMMING_TEMPLATE,
23
ANSI_STYLE_DIMMING_TEMPLATE_WITH_COMPONENT_STACK,
24
} from 'react-devtools-shared/src/constants';
25
-import {castBool, castBrowserTheme} from '../utils';
25
+import {castBool} from '../utils';
26
27
const OVERRIDE_CONSOLE_METHODS = ['error', 'trace', 'warn'];
28
124
breakOnConsoleErrors: false,
125
showInlineWarningsAndErrors: false,
126
hideConsoleLogsInStrictMode: false,
127
- browserTheme: 'dark',
127
};
128
129
// Patches console methods to append component stack for the current fiber.
133
breakOnConsoleErrors,
134
showInlineWarningsAndErrors,
135
hideConsoleLogsInStrictMode,
137
- browserTheme,
136
}: $ReadOnly<ConsolePatchSettings>): void {
137
// Settings may change after we've patched the console.
138
// Using a shared ref allows the patch function to read the latest values.
140
consoleSettingsRef.breakOnConsoleErrors = breakOnConsoleErrors;
141
consoleSettingsRef.showInlineWarningsAndErrors = showInlineWarningsAndErrors;
142
consoleSettingsRef.hideConsoleLogsInStrictMode = hideConsoleLogsInStrictMode;
145
- consoleSettingsRef.browserTheme = browserTheme;
143
144
if (
145
appendComponentStack ||
409
const hideConsoleLogsInStrictMode =
410
castBool(window.__REACT_DEVTOOLS_HIDE_CONSOLE_LOGS_IN_STRICT_MODE__) ??
411
false;
415
- const browserTheme =
416
- castBrowserTheme(window.__REACT_DEVTOOLS_BROWSER_THEME__) ?? 'dark';
412
413
patch({
414
appendComponentStack,
415
breakOnConsoleErrors,
416
showInlineWarningsAndErrors,
417
hideConsoleLogsInStrictMode,
423
- browserTheme,
418
});
419
}
420
432
settings.showInlineWarningsAndErrors;
433
window.__REACT_DEVTOOLS_HIDE_CONSOLE_LOGS_IN_STRICT_MODE__ =
434
settings.hideConsoleLogsInStrictMode;
441
- window.__REACT_DEVTOOLS_BROWSER_THEME__ = settings.browserTheme;
435
}
436
437
export function installConsoleFunctionsToWindow(): void {