Browse Source

Use LogLevel.log() rather than checking the log level manually

See gh-46466

Signed-off-by: Now <khj990322@gmail.com>
pull/46838/head
Now 8 months ago committed by Stéphane Nicoll
parent
commit
fa226e890b
  1. 9
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/DeferredLog.java

9
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/DeferredLog.java

@ -246,14 +246,7 @@ public class DeferredLog implements Log { @@ -246,14 +246,7 @@ public class DeferredLog implements Log {
}
static void logTo(Log log, LogLevel level, Object message, Throwable throwable) {
switch (level) {
case TRACE -> log.trace(message, throwable);
case DEBUG -> log.debug(message, throwable);
case INFO -> log.info(message, throwable);
case WARN -> log.warn(message, throwable);
case ERROR -> log.error(message, throwable);
case FATAL -> log.fatal(message, throwable);
}
level.log(log, message, throwable);
}
static class Lines implements Iterable<Line> {

Loading…
Cancel
Save