runLogs function

Future<LogsResult> runLogs(
  1. LogsInput input
)

Reads filtered app logs from the fdb session log file.

Never throws; all error conditions are represented as sealed result cases.

Implementation

Future<LogsResult> runLogs(LogsInput input) async {
  final file = File(input.logFilePath);
  if (!file.existsSync()) {
    return const LogsFileNotFound();
  }

  if (input.follow) {
    return _followStream(file: file, tag: input.tag);
  }

  return _snapshotStream(file: file, tag: input.tag, last: input.last);
}