Skip to content

Commit aa428a7

Browse files
committed
Support for unplanned logger calls
1 parent c80e6e8 commit aa428a7

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

log4j-weaver/src/main/java/org/apache/logging/log4j/weaver/log4j2/LoggerConversionHandler.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -132,25 +132,15 @@ public void handleMethodInstruction(LocationMethodVisitor mv, String name, Strin
132132
case "throwing":
133133
handleCatchingThrowing(mv, descriptor, "throwing".equals(name));
134134
break;
135-
case "isDebugEnabled":
136-
case "isEnabled":
137-
case "isErrorEnabled":
138-
case "isFatalEnabled":
139-
case "isInfoEnabled":
140-
case "isTraceEnabled":
141-
case "isWarnEnabled":
142-
case "logMessage":
143-
// These are NOPs
144-
mv.invokeInterface(LOGGER_TYPE, new Method(name, descriptor));
145-
break;
146135
case "traceEntry":
147136
handleTraceEntry(mv, descriptor);
148137
break;
149138
case "traceExit":
150139
handleTraceExit(mv, descriptor);
151140
break;
152141
default:
153-
throw new ConversionException("Unsupported method 'org.apache.logging.log4j.Logger#" + name + "'.");
142+
// The default is to not change the original call
143+
mv.invokeInterface(LOGGER_TYPE, new Method(name, descriptor));
154144
}
155145
}
156146

0 commit comments

Comments
 (0)