CapturedOutputMsg class
Message sent when a print() or stderr write is intercepted by the
output-capture system.
When ProgramOptions.captureOutput is enabled, calls to print() inside
the program zone are intercepted and dispatched as CapturedOutputMsg
instead of being written to the terminal (which would corrupt the TUI).
Models can collect these messages to display in a debug panel, log viewer, or simply ignore them.
Example
@override
(Model, Cmd?) update(Msg msg) {
return switch (msg) {
CapturedOutputMsg(:final line, :final source) => (
copyWith(logs: [...logs, '[$source] $line']),
null,
),
_ => (this, null),
};
}
Constructors
- CapturedOutputMsg(String line, {OutputSource source = OutputSource.stdout})
-
Creates a captured output message.
const
Properties
- dropWhenInputQueued → bool
-
Whether this message can be dropped when fresher user input is queued.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- line → String
-
The captured output line.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- source → OutputSource
-
Where the output originated from.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited