export method

Future<String> export()

Everything kept, oldest first, one JSON object per line: the device's log file when there is one, otherwise the in-memory records. What a person sends when they are asked for the logs.

Implementation

Future<String> export() async {
  final DVLogFile? file = DVObservability.logFile;
  if (file != null) return file.export();
  final StringBuffer out = StringBuffer();
  for (final DVLogRecord record in DVObservability.recentLogs) {
    out.writeln(record.toJsonLine());
  }
  return out.toString();
}