dockerLog method

  1. @visibleForTesting
Stream<String> dockerLog(
  1. String containerid, {
  2. int lines = 100,
  3. bool follow = false,
})

Returns the last lines of containerid and then follows the file.

Implementation

@visibleForTesting
Stream<String> dockerLog(String containerid,
    {int lines = 100, bool follow = false}) {
  verbose(() => 'docker logs:  $lines  ${Isolate.current.debugName}');

  var cmd = 'docker logs --tail $lines $containerid';

  if (follow) {
    cmd += ' -f';
  }

  return cmd.stream();
}