getAllLogs method

Future<List<Log>> getAllLogs([
  1. int? waitTimeout = null
])
override

Returns all log entries generated for this session. If there are asynchronous logs that are not delivered yet, this method waits for them until waitTimeout.

Implementation

Future<List<Log>> getAllLogs([int? waitTimeout = null]) async {
  try {
    return _platform
        .abstractSessionGetAllLogs(this.getSessionId(), waitTimeout)
        .then((allLogs) {
      if (allLogs == null) {
        return List.empty();
      } else {
        return allLogs
            .map((dynamic logObject) =>
                FFmpegKitFactory.mapToLog(logObject as Map<dynamic, dynamic>))
            .toList();
      }
    });
  } on PlatformException catch (e, stack) {
    print("Plugin getAllLogs error: ${e.message}");
    return Future.error("getAllLogs failed.", stack);
  }
}