PrintSink class

A LogSinkMixin which uses the print function to write logs to.

formatter is used to format LogRecord before printing it.

Inheritance

Constructors

PrintSink(LogRecordFormatter formatter, [LogFilter filter = const LogFilter.none()])
Creates a sink which writes its log-records with print.

Properties

filter → LogFilter
Decides which log-records make it to write.
finalinherited
formatter → LogRecordFormatter
Used to format LogRecord before printing it.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → Future<void>
Cancels all subscriptions to log-streams and releases the resources of this sink.
inherited
listenTo(Stream<LogRecord> logStream) → void
Starts listening for new log-records from the logStream.
inherited
log(LogRecord logRecord) → Future<void>
Writes logRecord to 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 logRecord to wherever this sink goes, without applying filter.
override

Operators

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

Constants

lineSplitter → const LineSplitter
Splits a formatted log-record into the lines which are printed separately.