printerr function

void printerr(
  1. String? line
)

printerr provides the equivalent functionality to the standard Dart print function but instead writes the output to stderr rather than stdout.

CLI applications should, by convention, write error messages out to stderr and expected output to stdout.

line the line to write to stderr.

Implementation

void printerr(String? line) {
  /// Co-operate with runDCliZone
  final overloaded = Zone.current[capturePrinterrKey] as CaptureZonePrintErr?;
  if (overloaded != null) {
    overloaded(line);
  } else {
    stderr.writeln(line);
  }
}