Skip to content

Commit ebbae15

Browse files
committed
when logging disabled, assign NOPLogger directly.
1 parent 6605ef3 commit ebbae15

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gax-java/gax/src/main/java/com/google/api/gax/logging/LoggingUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import org.slf4j.Marker;
4343
import org.slf4j.helpers.FormattingTuple;
4444
import org.slf4j.helpers.MessageFormatter;
45+
import org.slf4j.helpers.NOPLogger;
4546

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

6061
ILoggerFactory loggerFactory = LoggerFactory.getILoggerFactory();

0 commit comments

Comments
 (0)