TestLogWriter class

A LogWriter that collects entries and scopes for test assertions.

Inheritance
Annotations
  • @visibleForTesting

Constructors

TestLogWriter()

Properties

closedScopes List<ClosedScope>
Scopes closed via closeScope, in call order, with their close-time success/error details.
final
entries List<LogEntry>
Log entries written via log, in call order.
final
hashCode int
The hash code for this object.
no setterinherited
openedScopes List<LogScope>
Scopes opened via openScope, in call order.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() Future<void>
Releases any resources held by the writer.
inherited
closeScope(LogScope scope, {required bool success, required Duration duration, Object? error, StackTrace? stackTrace}) Future<void>
Ends a scoped operation.
override
log(LogEntry entry) Future<void>
Writes a single log entry.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openScope(LogScope scope) Future<void>
Begins a scoped operation.
override
toString() String
A string representation of this object.
inherited

Operators

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