getLogs method

Future<List<Log>> getLogs()
override

Returns all log entries delivered for this session. Note that if there are asynchronous logs that are not delivered yet, this method will not wait for them and will return immediately.

Implementation

Future<List<Log>> getLogs() async {
  try {
    return _platform
        .abstractSessionGetLogs(this.getSessionId())
        .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 getLogs error: ${e.message}");
    return Future.error("getLogs failed.", stack);
  }
}