From da298cd450e75b04acf8b4f3df1cc8326851f35a Mon Sep 17 00:00:00 2001 From: Now Date: Sat, 19 Jul 2025 00:55:00 +0900 Subject: [PATCH] Replace switch with LogLevel.log() method in DeferredLog Signed-off-by: Now --- .../org/springframework/boot/logging/DeferredLog.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/core/spring-boot/src/main/java/org/springframework/boot/logging/DeferredLog.java b/core/spring-boot/src/main/java/org/springframework/boot/logging/DeferredLog.java index 18fd7452417c..28466c8c7675 100644 --- a/core/spring-boot/src/main/java/org/springframework/boot/logging/DeferredLog.java +++ b/core/spring-boot/src/main/java/org/springframework/boot/logging/DeferredLog.java @@ -246,14 +246,7 @@ public static Log replay(Log source, Log destination) { } 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 {