Skip to content

Commit adde2ed

Browse files
alexeylangfacebook-github-bot
authored andcommitted
Fix the debug logging regression
Reviewed By: AaaChiuuu Differential Revision: D5975880 fbshipit-source-id: 39c632ddf84e57c814b54fac465651120e4127da
1 parent bee33a4 commit adde2ed

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

ReactAndroid/src/main/java/com/facebook/react/bridge/JavaMethodWrapper.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ public Promise extractArgument(
135135
}
136136
};
137137

138+
private static final boolean DEBUG =
139+
PrinterHolder.getPrinter().shouldDisplayLogMessage(ReactDebugOverlayTags.BRIDGE_CALLS);
140+
138141
private static char paramTypeToChar(Class paramClass) {
139142
char tryCommon = commonTypeToChar(paramClass);
140143
if (tryCommon != '\0') {
@@ -332,12 +335,14 @@ public void invoke(JSInstance jsInstance, ReadableNativeArray parameters) {
332335
SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "callJavaModuleMethod")
333336
.arg("method", traceName)
334337
.flush();
335-
PrinterHolder.getPrinter()
336-
.logMessage(
337-
ReactDebugOverlayTags.BRIDGE_CALLS,
338-
"JS->Java: %s.%s()",
339-
mModuleWrapper.getName(),
340-
mMethod.getName());
338+
if (DEBUG) {
339+
PrinterHolder.getPrinter()
340+
.logMessage(
341+
ReactDebugOverlayTags.BRIDGE_CALLS,
342+
"JS->Java: %s.%s()",
343+
mModuleWrapper.getName(),
344+
mMethod.getName());
345+
}
341346
try {
342347
if (!mArgumentsProcessed) {
343348
processArguments();

0 commit comments

Comments
 (0)