Add flogger and android logging support

This commit is contained in:
Porcuiney Hairs
2021-03-03 03:42:21 +05:30
parent 17d7ba8049
commit d0c82d3756

View File

@@ -9,17 +9,22 @@ class LoggingCall extends MethodAccess {
LoggingCall() {
exists(RefType t, Method m |
t.hasQualifiedName("org.apache.log4j", "Category") or // Log4j 1
t.hasQualifiedName("org.apache.logging.log4j", ["Logger", "LogBuilder"]) or // Log4j 2
t.hasQualifiedName("org.apache.logging.log4j", ["Logger", "LogBuilder"]) or // Log4j 2
t.hasQualifiedName("org.apache.commons.logging", "Log") or
// JBoss Logging (`org.jboss.logging.Logger` in some implementations like JBoss Application Server 4.0.4 did not implement `BasicLogger`)
t.hasQualifiedName("org.jboss.logging", ["BasicLogger", "Logger"]) or
t.hasQualifiedName("org.slf4j.spi", "LoggingEventBuilder") or
t.hasQualifiedName("org.slf4j", "Logger") or
t.hasQualifiedName("org.scijava.log", "Logger") or
t.hasQualifiedName("com.google.common.flogger", "LoggingApi") or
t.hasQualifiedName("java.lang", "System$Logger") or
t.hasQualifiedName("java.util.logging","Logger")
t.hasQualifiedName("java.util.logging", "Logger") or
t.hasQualifiedName("android.util.Log", _)
|
m.getDeclaringType().(RefType).extendsOrImplements*(t) and
(
m.getDeclaringType().getASourceSupertype*() = t or
m.getDeclaringType().(RefType).extendsOrImplements*(t)
) and
m.getReturnType() instanceof VoidType and
this = m.getAReference()
)