Log class

Logging for the coordination layer.

The core here is pure Dart so it works on the VM and on the web. Two things that used to make it VM-only are now abstracted:

  • Colour detection. dart:io's stdout.supportsAnsiEscapes is behind a conditional import, defaulting to "no colour" everywhere else — browser consoles render ANSI codes as literal garbage.
  • Forwarding. This used to take a dart:isolate SendPort directly. It now takes a plain callback (forwardTo), so the isolate dependency belongs to the caller that actually has isolates. The web has no isolates, and a WebSocket transport needs no worker at all.

Constructors

Log()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Static Properties

useColors ↔ bool
Whether output should be colourised.
getter/setter pair

Static Methods

defaultPrinter(LogRecord record) → void
A ready-made printer: Logger.root.onRecord.listen(Log.defaultPrinter).
forwardTo(void sink(LogRecord record)?) → void
Sends every record to sink instead of handling it locally.
logIsolateMessage(LogRecord record) → Future<void>
replayRecord(LogRecord record) → Future<void>
Re-emits a record received from a forwarding context, preserving its original level, error and stack trace.
wrapMessageColor(String message, Level level) → String

Constants

forwardedLoggerName → const String
Name used while records are being forwarded to another execution context.
isolateLoggerName → const String
loggerName → const String