getAllLogs method

  1. @override
Future<List<Log>> getAllLogs([
  1. int? waitTimeout
])
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

@override
Future<List<Log>> getAllLogs([int? waitTimeout]) async {
  try {
    return _platform
        .abstractSessionGetAllLogs(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) {
    debugPrint("Plugin getAllLogs error: ${e.message}");
    return Future.error("getAllLogs failed.", stack);
  }
}