currentStderr top-level property

IOSink currentStderr

Returns a sink for writing directly to the current stderr stream.

In a capture block, this writes to the captured stderr 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 currentStderr {
  var fromZone = Zone.current[stderrKey];
  return fromZone is StdioGroup ? fromZone.sink : stderr;
}