Skip to content

Commit 29e9ce1

Browse files
committed
Polish variables
Extract a few more variables to make the format command easier to follow.
1 parent 8575ec0 commit 29e9ce1

File tree

1 file changed

+4
-2
lines changed
  • spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/java

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ public class SimpleFormatter extends Formatter {
4242
public String format(LogRecord record) {
4343
Date date = new Date(record.getMillis());
4444
String source = record.getLoggerName();
45+
String loggerName = record.getLoggerName();
46+
String level = record.getLevel().getLocalizedName();
4547
String message = formatMessage(record);
4648
String throwable = getThrowable(record);
4749
String thread = getThreadName();
48-
return String.format(this.format, date, source, record.getLoggerName(), record.getLevel().getLocalizedName(),
49-
message, throwable, thread, this.pid);
50+
String pid = this.pid;
51+
return String.format(this.format, date, source, loggerName, level, message, throwable, thread, pid);
5052
}
5153

5254
private String getThrowable(LogRecord record) {

0 commit comments

Comments
 (0)