private void printDiagnosticsNodeProperty()

in flutter-idea/src/io/flutter/logging/FlutterConsoleLogManager.java [345:412]


  private void printDiagnosticsNodeProperty(ConsoleView console, String indent, DiagnosticsNode property,
                                            ConsoleViewContentType contentType,
                                            boolean isInChild) {
    // TODO(devoncarew): Change the error message display in the framework.
    if (property.getDescription() != null && property.getLevel() == DiagnosticLevel.info) {
      // Elide framework blank styling lines.
      if (StringUtil.equals("ErrorSpacer", property.getType())) {
        return;
      }
    }

    if (contentType == null) {
      contentType = getContentTypeFor(property.getLevel());
    }

    console.print(indent, contentType);

    if (property.getShowName()) {
      final String name = property.getName();
      console.print(name == null ? "" : name, contentType);

      if (property.getShowSeparator()) {
        console.print(property.getSeparator() + " ", contentType);
      }
    }

    final String description = property.getDescription() == null ? "" : property.getDescription();
    console.print(description + "\n", contentType);

    if (property.hasInlineProperties()) {
      String childIndent = getChildIndent(indent, property);
      if (property.getStyle() == DiagnosticsTreeStyle.shallow && !indent.startsWith("...")) {
        // Render properties of shallow nodes as collapesed.
        childIndent = "...  " + indent;
      }
      for (DiagnosticsNode childProperty : property.getInlineProperties()) {
        printDiagnosticsNodeProperty(console, childIndent, childProperty, contentType, isInChild);
      }
    }

    if (property.hasChildren()) {
      final CompletableFuture<ArrayList<DiagnosticsNode>> future = property.getChildren();
      final ArrayList<DiagnosticsNode> children = future.getNow(emptyList);

      // Don't collapse children if it's just a flat list of children.
      if (!isInChild && children.stream().noneMatch(DiagnosticsNode::hasChildren)) {
        final String childIndent = getChildIndent(indent, property);
        for (DiagnosticsNode child : children) {
          printDiagnosticsNodeProperty(console, childIndent, child, contentType, false);
        }
      }
      else {
        if (property.getStyle() != DiagnosticsTreeStyle.shallow) {
          // For deep trees, we show the text as collapsed.
          final String childIndent = isInChild ? getChildIndent(indent, property) : "...  " + indent;

          for (DiagnosticsNode child : children) {
            printDiagnosticsNodeProperty(console, childIndent, child, contentType, true);
          }
        }
      }
    }

    // Print an extra line after the summary.
    if (property.getLevel() == DiagnosticLevel.summary) {
      console.print("\n", contentType);
    }
  }