Skip to content

Commit 2f4aa75

Browse files
committed
fix SLF4J-575
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
1 parent 363f0a5 commit 2f4aa75

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

slf4j-api/src/main/java/org/slf4j/LoggerFactory.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,9 @@ private static void replaySingleEvent(SubstituteLoggingEvent event) {
304304
if (substLogger.isDelegateNOP()) {
305305
// nothing to do
306306
} else if (substLogger.isDelegateEventAware()) {
307-
substLogger.log(event);
307+
if(substLogger.isEnabledForLevel(event.getLevel())) {
308+
substLogger.log(event);
309+
}
308310
} else {
309311
Util.report(loggerName);
310312
}

slf4j-api/src/main/java/org/slf4j/spi/LoggingEventAware.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@
44

55
/**
66
* A logger capable of logging from org.slf4j.event.LoggingEvent implements this interface.
7-
*
7+
*
8+
* <p>Please note that when the {@link #log(LoggingEvent)} method assumes that
9+
* the event was filtered beforehand and no further filtering needs to occur by the method itself.
10+
* <p>
11+
*
12+
* <p>Implementations of this interface <b>may</b> apply further filtering but they are not
13+
* required to do so. In other words, {@link #log(LoggingEvent)} method is free to assume that
14+
* the event was filtered beforehand and no further filtering needs to occur in the method itself.</p>
15+
*
16+
* See also https://jira.qos.ch/browse/SLF4J-575
17+
*
818
* @author Ceki Gulcu
919
* @since 2.0.0
1020
*/

0 commit comments

Comments
 (0)