fetchContainerLog static method
Implementation
static Future<List<LogRecord>> fetchContainerLog(
final Client cloudApiClient, {
required final String projectId,
required final DateTime? before,
required final DateTime? after,
required final int limit,
}) async {
try {
final Stream<LogRecord> stream;
if (before == null && after == null) {
stream = cloudApiClient.logs.fetchRecentRecords(
cloudCapsuleId: projectId,
limit: limit,
);
} else {
stream = cloudApiClient.logs.fetchRecords(
cloudCapsuleId: projectId,
beforeTime: before,
afterTime: after,
limit: limit,
);
}
return await stream.toList();
} on Exception catch (e, s) {
throw FailureException.nested(e, s, 'Error while fetching log records');
}
}