export static method

String export({
  1. ExportFormat format = ExportFormat.text,
})

Export recent history as human-readable text (one line per record).

Pass format to choose between text and json (NDJSON).

Implementation

static String export({ExportFormat format = ExportFormat.text}) {
  final h = LogPilotZone.history;
  if (h == null || h.isEmpty) return '';
  return switch (format) {
    ExportFormat.text => h.exportAsText(),
    ExportFormat.json => h.exportAsJson(),
  };
}