parse method

void parse(
  1. String line
)

Parse the line from the process output.

Implementation

void parse(String line) {
  try {
    if (line.contains('PATROL_LOG')) {
      _parsePatrolLog(line);
    } else if (showFlutterLogs) {
      return switch (line) {
        _ when line.contains('(Flutter) flutter:') => _parseFlutterIOsLog(
          line,
        ),
        _ when line.contains('I flutter :') => _parseFlutterAndroidLog(line),
        _ when line.contains('flutter:') => _parseFlutterIOsReleaseLog(line),
        _ when line.contains('Playwright:') => _parsePlaywrightLog(line),
        // Pass through any other line verbatim instead of silently
        // dropping it. Previously a raw Node/Playwright exception thrown
        // out of the Playwright fixture (never routed through
        // `page.on('console')`, the only thing that prefixes browser text
        // with `Playwright:`) fell into this branch and vanished, leaving
        // only a misleading "Total: 0 / Playwright process exited
        // unexpectedly" in CI logs with no indication of the real cause.
        // Scoped strictly inside `showFlutterLogs` (verbose mode) — the
        // default (non-verbose) parse path above is unchanged.
        _ => log(line),
      };
    }
  } catch (err) {
    log('Error parsing line: $line');
  }
}