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.logfor message text (no auto-appended Chrome call stack)console.dirfor structured data (native expandable object tree)%c-styledconsole.logfor 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, suppressesType.toString()from the label header.dart compile jsminifies type names in release builds while leavingdart.vm.productasfalse— set this explicitly totruein 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
entryto 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