WebConsolePrinter class

Chrome DevTools-native log printer for web platforms.

Uses %c CSS styling on console.groupCollapsed (via custom @JS bindings) to give group headers severity-appropriate colors derived from StyleResolver.defaultLevelColors. Body content uses:

  • console.log for message text (no auto-appended Chrome call stack)
  • console.dir for structured data (native expandable object tree)
  • %c-styled console.log for exceptions (red text)
  • StackTraceParser-formatted text for stack traces (aligned columns, internal frames filtered)

This printer is the default on web platforms (see printer_factory_web.dart). On native platforms, ComposablePrinter with environment-detected presets is used instead.

Implemented types

Constructors

WebConsolePrinter({int methodCount = 8, int? errorMethodCount, bool suppressTypeNames = false})

Properties

errorMethodCount int?
Maximum stack frames for error/fatal entries (falls back to methodCount when null).
final
hashCode int
The hash code for this object.
no setterinherited
methodCount int
Maximum stack frames to display.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
suppressTypeNames bool
When true, suppresses Type.toString() from the label header. dart compile js minifies type names in release builds while leaving dart.vm.product as false — set this explicitly to true in production web bundles to avoid [c8.fn]-style noise.
final

Methods

dispose() → void
Releases any resources held by this printer (timers, file handles, network sockets, etc.).
override
log(LogEntry entry) → void
Emits entry to this printer's destination.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited