Skip to content

Commit

Permalink
when logging disabled, assign NOPLogger directly.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhumin8 committed Nov 27, 2024
1 parent 6605ef3 commit ebbae15
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.slf4j.Marker;
import org.slf4j.helpers.FormattingTuple;
import org.slf4j.helpers.MessageFormatter;
import org.slf4j.helpers.NOPLogger;

@InternalApi
public class LoggingUtils {
Expand All @@ -54,7 +55,7 @@ private LoggingUtils() {}
public static Logger getLogger(Class<?> clazz) {
if (!isLoggingEnabled()) {
// use SLF4j's NOP logger regardless of bindings
return LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
return LoggerFactory.getLogger(NOPLogger.class);
}

ILoggerFactory loggerFactory = LoggerFactory.getILoggerFactory();
Expand Down

0 comments on commit ebbae15

Please sign in to comment.