[0.76][Fix] Restore Metro log forwarding, change notice to signal future removal (#46815)

This commit is contained in:
Alex Hunt
2024-10-07 15:41:56 +01:00
committed by GitHub
parent 531657b394
commit 6047f9cc09
2 changed files with 11 additions and 6 deletions
@@ -42,9 +42,13 @@ if (__DEV__) {
if (!Platform.isTesting) {
const HMRClient = require('../Utilities/HMRClient');
// [0.76 only] When under React Native DevTools, log "JavaScript logs will
// be removed from Metro..." warning, and continue to forward logs.
if (global.__FUSEBOX_HAS_FULL_CONSOLE_SUPPORT__) {
HMRClient.unstable_notifyFuseboxConsoleEnabled();
} else if (console._isPolyfilled) {
}
if (console._isPolyfilled) {
// We assume full control over the console and send JavaScript logs to Metro.
[
'trace',
+6 -5
View File
@@ -153,11 +153,12 @@ const HMRClient: HMRClientNativeInterface = {
level: 'info',
data: [
'\n' +
'\x1b[7m' +
' \x1b[1mJavaScript logs have moved!\x1b[22m They will now appear in the debugger console. ' +
'Tip: Type \x1b[1mj\x1b[22m in the terminal to open the debugger (requires Google Chrome ' +
'or Microsoft Edge).' +
'\x1b[27m' +
'\u001B[7m' +
' \u001B[1m💡 JavaScript logs will be removed from Metro in React ' +
'Native 0.77!\u001B[22m Please use React Native DevTools as your ' +
'default tool. Tip: Type \u001B[1mj\u001B[22m in the terminal to ' +
'open (requires Google Chrome or Microsoft Edge).' +
'\u001B[27m' +
'\n',
],
}),