Simplify format method.

This commit is contained in:
Photon-GitHub 2022-07-25 13:47:24 +02:00
parent 5a14d943fb
commit aef9de2555
1 changed files with 2 additions and 9 deletions

View File

@ -270,15 +270,8 @@ public class PacketLogging implements CommandExecutor, PacketListener {
@Override
public String format(LogRecord record) {
String string = formatMessage(record);
if (string.isEmpty()) {
return LINE_SEPARATOR;
}
StringBuilder message = new StringBuilder();
message.append(MessageFormat.format(FORMAT, DATE.format(record.getMillis()), string));
message.append(LINE_SEPARATOR);
return message.toString();
final String string = formatMessage(record);
return string.isEmpty() ? LINE_SEPARATOR : MessageFormat.format(FORMAT, DATE.format(record.getMillis()), string) + LINE_SEPARATOR;
}
}
}