TextLogWriter class

A SpinnerLogWriter that writes formatted text to stdout/stderr.

Log messages are prefixed with the level (DEBUG, WARNING, ERROR). Errors and stack traces are written to stderr.

Inheritance

Constructors

TextLogWriter()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scopeStack → List<ActiveScope>
Stack of currently-open scopes, innermost last. The innermost entry drives the active spinner line.
finalinherited

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.
inherited
formatScopeComplete(LogScope scope, bool success, Duration duration) → String
Format the scope completion line. Default uses ✓/✗ with the label and elapsed time.
override
formatScopeEnd(LogScope scope, bool success, Duration duration) → String
Format the scope completion for non-interactive output.
inherited
formatScopeStart(LogScope scope) → String
Format the scope label for non-interactive (pipe) output.
inherited
formatSpinner(String frame, ActiveScope active) → String
Format the spinner text for the currently active scope. Default uses green braille frames with gray elapsed time.
override
log(LogEntry entry) → Future<void>
Writes a single log entry.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openScope(LogScope scope) → Future<void>
Begins a scoped operation.
inherited
toString() → String
A string representation of this object.
inherited
writeLogLine(LogEntry entry) → void
Write a single log entry to the terminal. Called after the spinner line has been cleared and before it is redrawn.
override

Operators

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