Skip to content

Commit d0c82d3

Browse files
author
Porcuiney Hairs
committed
Add flogger and android logging support
1 parent 17d7ba8 commit d0c82d3

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

java/ql/src/experimental/semmle/code/java/Logging.qll

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,22 @@ class LoggingCall extends MethodAccess {
99
LoggingCall() {
1010
exists(RefType t, Method m |
1111
t.hasQualifiedName("org.apache.log4j", "Category") or // Log4j 1
12-
t.hasQualifiedName("org.apache.logging.log4j", ["Logger", "LogBuilder"]) or // Log4j 2
12+
t.hasQualifiedName("org.apache.logging.log4j", ["Logger", "LogBuilder"]) or // Log4j 2
1313
t.hasQualifiedName("org.apache.commons.logging", "Log") or
1414
// JBoss Logging (`org.jboss.logging.Logger` in some implementations like JBoss Application Server 4.0.4 did not implement `BasicLogger`)
1515
t.hasQualifiedName("org.jboss.logging", ["BasicLogger", "Logger"]) or
1616
t.hasQualifiedName("org.slf4j.spi", "LoggingEventBuilder") or
1717
t.hasQualifiedName("org.slf4j", "Logger") or
1818
t.hasQualifiedName("org.scijava.log", "Logger") or
19+
t.hasQualifiedName("com.google.common.flogger", "LoggingApi") or
1920
t.hasQualifiedName("java.lang", "System$Logger") or
20-
t.hasQualifiedName("java.util.logging","Logger")
21+
t.hasQualifiedName("java.util.logging", "Logger") or
22+
t.hasQualifiedName("android.util.Log", _)
2123
|
22-
m.getDeclaringType().(RefType).extendsOrImplements*(t) and
24+
(
25+
m.getDeclaringType().getASourceSupertype*() = t or
26+
m.getDeclaringType().(RefType).extendsOrImplements*(t)
27+
) and
2328
m.getReturnType() instanceof VoidType and
2429
this = m.getAReference()
2530
)

0 commit comments

Comments
 (0)