@@ -139,8 +139,6 @@ private static SimpleFormatter getFormatter(
139
139
140
140
// log format
141
141
return new SimpleFormatter () {
142
- private final String formatLayout =
143
- logThreadName ? JDK14_WITH_THREADS_LAYOUT : JDK14_LAYOUT ;
144
142
145
143
private String simpleClassName (String str ) {
146
144
int start = str .lastIndexOf ('.' );
@@ -170,14 +168,8 @@ public synchronized String format(LogRecord lr) {
170
168
Throwable throwable = new Throwable ();
171
169
StackTraceElement logEmissionFrame = throwable .getStackTrace ()[6 ];
172
170
173
- final String logFormat ;
174
171
if (logThreadName ) {
175
- logFormat = JDK14_WITH_THREADS_LAYOUT_FILE_LINE ;
176
- } else {
177
- logFormat = JDK14_LAYOUT_FILE_LINE ;
178
- }
179
- if (logThreadName ) {
180
- return String .format (logFormat ,
172
+ return String .format (JDK14_WITH_THREADS_LAYOUT_FILE_LINE ,
181
173
dateFormatter .format (new Date ()),
182
174
LogLevel .fromJulLevel (lr .getLevel ()).toString (),
183
175
Thread .currentThread ().getName (),
@@ -187,7 +179,8 @@ public synchronized String format(LogRecord lr) {
187
179
exception
188
180
);
189
181
}
190
- return String .format (logFormat ,
182
+
183
+ return String .format (JDK14_LAYOUT_FILE_LINE ,
191
184
dateFormatter .format (new Date ()),
192
185
LogLevel .fromJulLevel (lr .getLevel ()).toString (),
193
186
logEmissionFrame .getFileName (),
@@ -198,7 +191,7 @@ public synchronized String format(LogRecord lr) {
198
191
}
199
192
200
193
if (logThreadName ) {
201
- return String .format (formatLayout ,
194
+ return String .format (JDK14_WITH_THREADS_LAYOUT ,
202
195
dateFormatter .format (new Date ()),
203
196
LogLevel .fromJulLevel (lr .getLevel ()).toString (),
204
197
Thread .currentThread ().getName (),
@@ -207,7 +200,7 @@ public synchronized String format(LogRecord lr) {
207
200
exception
208
201
);
209
202
}
210
- return String .format (formatLayout ,
203
+ return String .format (JDK14_LAYOUT ,
211
204
dateFormatter .format (new Date ()),
212
205
LogLevel .fromJulLevel (lr .getLevel ()).toString (),
213
206
simpleClassName (lr .getSourceClassName ()),
0 commit comments