summaryrefslogtreecommitdiff
path: root/src/python-systemd/journal.py
diff options
context:
space:
mode:
authorSteven Hiscocks <steven@hiscocks.me.uk>2013-02-16 17:31:18 +0000
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-02-22 16:57:44 +0100
commit7a1b9cd5e43c85a3b1f22a0151ac5b6340fb0d0f (patch)
treed74b8099de190ff6f7e98e769923fc69b4e0b19a /src/python-systemd/journal.py
parent71766afa2d80ffe1b03c410f6d5ffdc140883314 (diff)
systemd-python: Moved _reader datetime usage to python
Diffstat (limited to 'src/python-systemd/journal.py')
-rw-r--r--src/python-systemd/journal.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/python-systemd/journal.py b/src/python-systemd/journal.py
index db35ba2005..46affcee00 100644
--- a/src/python-systemd/journal.py
+++ b/src/python-systemd/journal.py
@@ -123,6 +123,16 @@ class Journal(_Journal):
return set(self._convert_field(key, value)
for value in super(Journal, self).query_unique(key))
+ def seek_realtime(self, timestamp):
+ if isinstance(timestamp, datetime.datetime):
+ timestamp = int(timestamp.strftime("%s%f"))
+ return super(Journal, self).seek_realtime(timestamp)
+
+ def seek_monotonic(self, timestamp, bootid=None):
+ if isinstance(timestamp, datetime.timedelta):
+ timestamp = timestamp.totalseconds()
+ return super(Journal, self).seek_monotonic(timestamp, bootid)
+
def log_level(self, level):
"""Sets maximum log level by setting matches for PRIORITY."""
if 0 <= level <= 7: