private static int computeSectionLevel()

in log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/internal/SectionImpl.java [42:52]


    private static int computeSectionLevel(final StructuralNode section) {
        int level = 0;
        StructuralNode currentNode = section;
        while (currentNode != null) {
            if (currentNode instanceof Section || currentNode instanceof Document) {
                level++;
            }
            currentNode = (StructuralNode) currentNode.getParent();
        }
        return level;
    }