@Override
    public String format(LogRecord logRecord) {
        Object[] arguments = new Object[6];
        arguments[0] = logRecord.getThreadID();
        String fullClassName = logRecord.getSourceClassName();
        int lastDot = fullClassName.lastIndexOf('.');
        String className = fullClassName.substring(lastDot + 1);
        arguments[1] = className;
        arguments[2] = logRecord.getSourceMethodName();
        arguments[3] = DateTimeFormatter.ISO_LOCAL_TIME.format(
                LocalDateTime.ofInstant(Instant.ofEpochMilli(logRecord.getMillis()), ZoneOffset.UTC));
        arguments[4] = logRecord.getMessage();
        if (logRecord.getThrown() != null) {
            Writer result = new StringWriter();
            logRecord.getThrown().printStackTrace(new PrintWriter(result));
            arguments[5] = result.toString();
        } else {
            arguments[5] = "";
        }
        return messageFormat.format(arguments);
    }
@Test
    public void format() {
        BriefLogFormatter formatter = new BriefLogFormatter();
        LogRecord record = new LogRecord(Level.INFO, "message");
        record.setSourceClassName("org.example.Class");
        record.setSourceMethodName("method");
        record.setMillis(Instant.EPOCH.toEpochMilli());
        record.setThreadID(123);
        assertEquals("00:00:00 123 Class.method: message\n", formatter.format(record));
    }