MCPcopy Index your code
hub / github.com/react/react / reenableLogs

Function reenableLogs

packages/shared/ConsolePatchingDev.js:60–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58}
59
60export function reenableLogs(): void {
61 if (__DEV__) {
62 disabledDepth--;
63 if (disabledDepth === 0) {
64 const props = {
65 configurable: true,
66 enumerable: true,
67 writable: true,
68 };
69 // $FlowFixMe[cannot-write] Flow thinks console is immutable.
70 Object.defineProperties(console, {
71 log: {...props, value: prevLog},
72 info: {...props, value: prevInfo},
73 warn: {...props, value: prevWarn},
74 error: {...props, value: prevError},
75 group: {...props, value: prevGroup},
76 groupCollapsed: {...props, value: prevGroupCollapsed},
77 groupEnd: {...props, value: prevGroupEnd},
78 });
79 }
80 if (disabledDepth < 0) {
81 console.error(
82 'disabledDepth fell below zero. ' +
83 'This is a bug in React. Please file an issue.',
84 );
85 }
86 }
87}

Callers 1

Calls 1

errorMethod · 0.65

Tested by

no test coverage detected