renderSpan function

  1. @experimental
void renderSpan(
  1. LogSpan span,
  2. ConsoleMessageBuffer buffer
)

Renders a LogSpan tree to a ConsoleMessageBuffer.

Repeatedly calls LogSpan.build until the span returns itself (terminal), then calls LogSpan.render on the terminal span.

Implementation

@experimental
void renderSpan(LogSpan span, ConsoleMessageBuffer buffer) {
  // Build until terminal (span returns itself)
  var current = span;
  var built = current.build();
  while (!identical(built, current)) {
    current = built;
    built = current.build();
  }
  // Now current is terminal - call render directly
  current.render(buffer);
}