public ByteBuf format(@Nullable byte[] className, LogLevel level, ByteBuf msg) {
        ByteBuf buffer = PooledByteBufAllocator.DEFAULT.directBuffer(ESTIMATED_PATTERN_TEXT_LENGTH);
        try {
            return format0(buffer, className, level, msg);
        } catch (Exception e) {
            ReferenceCountUtil.safeEnsureReleased(buffer);
            ReferenceCountUtil.safeEnsureReleased(msg);
            throw e;
        }
    }
@author James Chen
@implNote 1. Note that we do NOT escape or remove non-printable characters for logging because it
          has an impact on performance. The caller of logger should ensure won't pass malicious
          texts especially the user input texts. 2. The template is designed for ascii-only text
          because: a. We won't convert String to the consistent UTF-8 bytes because it needs to
          copy memory b. We encourage caller to pass ascii-only texts only. In other words, if
          the message, args, or exception includes non-ascii text, the logger will just print
          error codes
turms-server-common/src/main/java/im/turms/server/common/infra/logging/core/layout/TurmsTemplateLayout.java