private ByteBuf format0(
            ByteBuf buffer,
            @Nullable byte[] className,
            LogLevel level,
            ByteBuf msg) {
        byte[] timestamp = DateTimeUtil.toBytes(System.currentTimeMillis());

        String threadName = Thread.currentThread()
                .getName();

        // Write template text

        buffer.writeBytes(timestamp)
                .writeByte(WHITESPACE)
                .writeBytes(LEVELS[level.ordinal()])
                .writeByte(WHITESPACE)
                .writeByte(nodeType)
                .writeByte(WHITESPACE)
                .writeBytes(nodeId)
                .writeByte(WHITESPACE);
        TracingContext context = LogThreadContext.get();
        // trace ID
        if (context == null) {
            pad(buffer, TRACE_ID_LENGTH);
        } else {
            long traceId = context.getTraceId();
            if (traceId != TracingContext.UNSET_TRACE_ID) {
                padStart(buffer, NumberFormatter.toCharBytes(traceId), TRACE_ID_LENGTH);
            }
        }
        // thread name
        buffer.writeByte(WHITESPACE)
                .writeBytes(StringUtil.getBytes(threadName));
        // class name
        if (className != null) {
            buffer.writeByte(WHITESPACE)
                    .writeBytes(className);
        }
        buffer.writeBytes(COLON_SEPARATOR);
        // eol
        msg.writeByte('\n');

        return PooledByteBufAllocator.DEFAULT.compositeBuffer(2)
                .addComponent(true, buffer)
                .addComponent(true, msg);
    }
@implNote Note that we do NOT escape or remove non-printable characters
turms-server-common/src/main/java/im/turms/server/common/infra/logging/core/layout/TurmsTemplateLayout.java