readAll method

Future<String> readAll()

Read and return the contents of all log files concatenated, ordered from oldest to newest.

Useful for exporting logs as a single string for bug reports.

Implementation

Future<String> readAll() async {
  await _flush();
  final files = logFiles.reversed.toList();
  final buffer = StringBuffer();
  for (final file in files) {
    buffer.write(await file.readAsString());
  }
  return buffer.toString();
}