mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-20 09:01:20 -08:00
Merge remote-tracking branch 'gui/main' into merge-gui-and-server
This commit is contained in:
commit
ae94de39b1
430 files changed
+44297
-50
No files matched your search
@@ -0,0 +1,32 @@
|
||||
package io.eiren.util.logging;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.logging.LogRecord;
|
||||
|
||||
|
||||
/**
|
||||
* Format message timestamp as time passed from the start with milliseconds.
|
||||
*/
|
||||
public class PreciseConsoleLogFormatter extends ShortConsoleLogFormatter {
|
||||
|
||||
private final long startMills;
|
||||
|
||||
public PreciseConsoleLogFormatter() {
|
||||
startMills = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SimpleDateFormat createDateFormat() {
|
||||
return new SimpleDateFormat("mm:ss.SSS");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void buildMessage(StringBuilder builder, LogRecord record) {
|
||||
builder.append(date.format(record.getMillis() - startMills));
|
||||
builder.append(" [");
|
||||
builder.append(record.getLevel().getLocalizedName().toUpperCase());
|
||||
builder.append("] ");
|
||||
builder.append(record.getMessage());
|
||||
builder.append('\n');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user