consoleCaptureZone property
ZoneSpecification
get
consoleCaptureZone
Zone interceptor that records print (and therefore debugPrint) once.
Flutter's test binding sets debugPrint to debugPrintSynchronously,
which forwards to print. Hooking both the global debugPrint callback
and this zone interceptor would duplicate every debugPrint line.
Device→host protocol lines (isEnsembleTestProtocolLine) still go to stdout for the CLI, but are not stored as application console logs.
Implementation
ZoneSpecification get consoleCaptureZone => ZoneSpecification(
print: (self, parent, zone, line) {
if (_forwardingDebugPrint == 0 && !isEnsembleTestProtocolLine(line)) {
consoleLogs.add(formatConsoleLine(line));
}
parent.print(zone, line);
},
);