kopia lustrzana https://github.com/jupyterhub/repo2docker
Expose `timestamps`, `since` args in Container.logs
Behavior is defined as what docker does needed for avoiding duplicate log statementspull/1016/head
rodzic
164efd31ab
commit
6966847bf9
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
-------
|
||||
|
|
Ładowanie…
Reference in New Issue