Expose `timestamps`, `since` args in Container.logs
Behavior is defined as what docker does
needed for avoiding duplicate log statements
MODIFY
repo2docker/docker.py
repo2docker/docker.py
@@ -13,8 +13,8 @@ class DockerContainer(Container):
def reload(self):
return self._c.reload()
- def logs(self, *, stream=False):
- return self._c.logs(stream=stream)
+ def logs(self, *, stream=False, timestamps=False, since=None):
+ return self._c.logs(stream=stream, timestamps=timestamps, since=since)
def kill(self, *, signal="KILL"):
return self._c.kill(signal=signal)

MODIFY
repo2docker/engine.py
repo2docker/engine.py
@@ -21,7 +21,7 @@ class Container(ABC):
"""
@abstractmethod
- def logs(self, *, stream=False):
+ def logs(self, *, stream=False, timestamps=False, since=None):
"""
Get the container logs.
@@ -29,6 +29,13 @@ class Container(ABC):
----------
stream : bool
If `True` return an iterator over the log lines, otherwise return all logs
+ timestamps : bool
+ If `True` log lines will be prefixed with iso8601 timestamps followed by space
+ since : int
+ An integer timestamp.
+ Can be constructed by parsing timestamps in prefixed lines issued when `timestamps=True`.
+ If given, start logs from this point,
+ instead of from container start.
Returns
-------

Expose `timestamps`, `since` args in Container.logs

Behavior is defined as what docker does

needed for avoiding duplicate log statements