Skip to content

Commit

Permalink
fix SLF4J-575
Browse files Browse the repository at this point in the history
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
  • Loading branch information
ceki committed Dec 10, 2022
1 parent 363f0a5 commit 2f4aa75
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion slf4j-api/src/main/java/org/slf4j/LoggerFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ private static void replaySingleEvent(SubstituteLoggingEvent event) {
if (substLogger.isDelegateNOP()) {
// nothing to do
} else if (substLogger.isDelegateEventAware()) {
substLogger.log(event);
if(substLogger.isEnabledForLevel(event.getLevel())) {
substLogger.log(event);
}
} else {
Util.report(loggerName);
}
Expand Down
12 changes: 11 additions & 1 deletion slf4j-api/src/main/java/org/slf4j/spi/LoggingEventAware.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@

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

0 comments on commit 2f4aa75

Please sign in to comment.