Commit 4001f492 authored by Michael Büsch's avatar Michael Büsch

logging: Add time information to log info

Signed-off-by: Michael Büsch's avatarMichael Buesch <m@bues.ch>
parent bea3cf03
......@@ -90,6 +90,8 @@ class Logging(object):
loglevel = LOG_INFO
prefix = ""
startupTime = monotonic_time()
@classmethod
def setLoglevel(cls, loglevel):
if loglevel not in (cls.LOG_NONE,
......@@ -111,6 +113,8 @@ class Logging(object):
if stream:
if cls.prefix:
stream.write(cls.prefix)
now = monotonic_time() - cls.startupTime
stream.write("[%.3f] " % now)
stream.write(text)
stream.write("\n")
stream.flush()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment