Skip to content

Commit fa226e8

Browse files
Kguswosnicoll
authored andcommitted
Use LogLevel.log() rather than checking the log level manually
See gh-46466 Signed-off-by: Now <[email protected]>
1 parent 6587e69 commit fa226e8

File tree

1 file changed

+1
-8
lines changed
  • spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging

1 file changed

+1
-8
lines changed

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,7 @@ public static Log replay(Log source, Log destination) {
246246
}
247247

248248
static void logTo(Log log, LogLevel level, Object message, Throwable throwable) {
249-
switch (level) {
250-
case TRACE -> log.trace(message, throwable);
251-
case DEBUG -> log.debug(message, throwable);
252-
case INFO -> log.info(message, throwable);
253-
case WARN -> log.warn(message, throwable);
254-
case ERROR -> log.error(message, throwable);
255-
case FATAL -> log.fatal(message, throwable);
256-
}
249+
level.log(log, message, throwable);
257250
}
258251

259252
static class Lines implements Iterable<Line> {

0 commit comments

Comments
 (0)