logs method

Future<(Uint8List, Uint8List)> logs(
  1. String id
)

Fetches the container's stdout and stderr log streams.

Issues two separate requests (stdout=true and stderr=true) and strips the 8-byte Docker multiplexed-stream header from each response before returning the raw log bytes.

Returns (stdoutBytes, stderrBytes).

Implementation

Future<(Uint8List, Uint8List)> logs(String id) async {
  final stdoutResp = await _request(
    'GET',
    '/containers/$id/logs',
    queryParams: {'stdout': 'true', 'stderr': 'false'},
  );
  final stderrResp = await _request(
    'GET',
    '/containers/$id/logs',
    queryParams: {'stdout': 'false', 'stderr': 'true'},
  );
  return (
    _stripDockerLogHeaders(stdoutResp.body),
    _stripDockerLogHeaders(stderrResp.body)
  );
}