public static byte[] formatClassName(String name) {
        byte[] rawBytes = name.getBytes(StandardCharsets.US_ASCII);
        if (rawBytes.length == CLASS_NAME_LENGTH) {
            return rawBytes;
        }
        if (rawBytes.length > CLASS_NAME_LENGTH) {
            String[] parts = StringUtils.tokenizeToStringArray(name, ".");
            String className = parts[parts.length - 1];
            int classNameLength = className.length();
            if (classNameLength >= CLASS_NAME_LENGTH) {
                return StringUtil.getBytes(className.substring(0, CLASS_NAME_LENGTH));
            }
            byte[] result = new byte[CLASS_NAME_LENGTH];
            int writeIndex = CLASS_NAME_LENGTH;
            for (int i = parts.length - 1; i >= 0; i--) {
                byte[] part = StringUtil.getBytes(parts[i]);
                if (i == parts.length - 1) {
                    writeIndex -= part.length;
                    System.arraycopy(part, 0, result, writeIndex, part.length);
                } else if (writeIndex >= 2) {
                    writeIndex -= 2;
                    result[writeIndex] = part[0];
                    result[writeIndex + 1] = '.';
                } else {
                    break;
                }
            }
            Arrays.fill(result, 0, writeIndex, (byte) ' ');
            return result;
        }
        return StringUtil
                .getBytes(StringUtil.padStartLatin1(name, CLASS_NAME_LENGTH, AsciiCode.SPACE));
    }
@return a class name in a byte array with the exact length of {@link CLASS_NAME_LENGTH}
turms-server-common/src/main/java/im/turms/server/common/infra/logging/core/layout/TurmsTemplateLayout.java