currentStdout top-level property
IOSink
currentStdout
Returns a sink for writing directly to the current stdout stream.
In a capture
block, this writes to the captured stdout stream. Otherwise,
it writes to the process's top-level stream.
This should not be closed, and error events should not be emitted on it. It should not be stored, as a given value may become invalid later on.
Implementation
IOSink get currentStdout {
var fromZone = Zone.current[stdoutKey];
return fromZone is StdioGroup ? fromZone.sink : stdout;
}