IsolateLogReceiver class final

Receives entries through a port (IsolateLogSink): each entry is passed to sink, usually the root logger's sink (RootLogger.asSink).

final logger = RootLogger(sinks: [...]);
final receiver = IsolateLogReceiver(logger.asSink());
// receiver.sendPort is passed to the isolate at spawn.

Entries arrive ready-made, so the root context (setContextAttribute) is not added to them: the background isolate has its own root with its own context. A message that fails to parse and a sink failure go to the sink's LogSink.diagnostics (for RootLogger.asSink, the root's channel) and do not block the following entries.

Until the receiver is closed (close), the port keeps the isolate alive.

Constructors

IsolateLogReceiver(LogSink sink)

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sendPort → SendPort
Port for the background isolate's IsolateLogSink.
no setter
sink → LogSink
Entry recipient; its LogSink.diagnostics also carries receive diagnostics.
final

Methods

close() → Future<void>
Stops receiving: entries sent after this are lost. sink is not closed: the caller owns it.
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