public static LogMessage of(Object format, Object... arguments) {
        String message = String.valueOf(format);
        Throwable t = null;

        int len = arguments != null ? arguments.length : 0;
        if (len > 0) {
            Object lastArg = arguments[len - 1];
            if (lastArg instanceof Throwable) {
                t = (Throwable) lastArg;
            }

            message = String.format(Locale.ROOT, message, arguments);
        }

        return new LogMessage(message, t);
    }
Creates a log message with arguments. The latest argument could be a
{@code java.lang.Throwable} providing details like stack trace of an error.

@param format    Object format, could be null
@param arguments arguments, could be null or empty
@return log message
clickhouse-data/src/main/java/com/clickhouse/logging/LogMessage.java