StreamLogSink class
A LogSinkMixin which exposes the log-records it receives as a Stream.
Constructors
- StreamLogSink([LogFilter filter = const LogFilter.none()])
- Creates a sink which exposes its log-records as a single-subscription stream.
- StreamLogSink.broadcast([LogFilter filter = const LogFilter.none()])
- Creates a sink which exposes its log-records as a broadcast stream.
Properties
- filter → LogFilter
-
Decides which log-records make it to write.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stream
→ Stream<
LogRecord> -
The log-records written to this sink.
no setter
Methods
-
dispose(
) → Future< void> -
Disposes this sink and closes the stream.
override
-
listenTo(
Stream< LogRecord> logStream) → void -
Starts listening for new log-records from the
logStream.inherited -
log(
LogRecord logRecord) → Future< void> -
Writes
logRecordto this sink, if filter allows it.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onError(
Object error, StackTrace stackTrace) → void -
Called when write fails or when a log-stream emits an error.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
write(
LogRecord logRecord) → Future< void> -
Writes
logRecordto wherever this sink goes, without applying filter.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited