private static boolean isFormattedLog4J(@NotNull PsiMethodCallExpression logCall) {
    PsiExpression qualifierExpression = logCall.getMethodExpression().getQualifierExpression();
    if (qualifierExpression == null) {
      return false;
    }

    boolean isLogBuilder = InheritanceUtil.isInheritor(qualifierExpression.getType(), LOG4J_BUILDER);
    if (isLogBuilder || InheritanceUtil.isInheritor(qualifierExpression.getType(), LOG4J_LOGGER)) {

      if (isLogBuilder) {
        while (qualifierExpression != null &&
               !InheritanceUtil.isInheritor(qualifierExpression.getType(), LOG4J_LOGGER)) {
          if (qualifierExpression instanceof PsiMethodCallExpression nextCall) {
            qualifierExpression = PsiUtil.skipParenthesizedExprDown(nextCall.getMethodExpression().getQualifierExpression());
          }
          else {
            qualifierExpression = null;
          }
        }
      }

      if (qualifierExpression != null) {
        boolean isFormatted = true;
        if (qualifierExpression instanceof PsiReferenceExpression referenceExpression &&
            referenceExpression.resolve() instanceof PsiVariable loggerVariable) {
          if (!loggerVariable.isPhysical() ||
              (loggerVariable.getInitializer() instanceof PsiMethodCallExpression callExpression &&
               GET_LOGGER.equals(callExpression.getMethodExpression().getReferenceName()))) {
            isFormatted = false;
          }
        }

        if (qualifierExpression instanceof PsiMethodCallExpression callExpression &&
            GET_LOGGER.equals(callExpression.getMethodExpression().getReferenceName())) {
          isFormatted = false;
        }

        if (isFormatted) {
          return true;
        }
      }
    }
    return false;
  }
private static boolean isFormattedLog4J(@NotNull PsiMethodCallExpression logCall)