Include timestamps (with 100 us resolution) in Sugar logfiles, to allow debugging of IPC and timeouts

This commit is contained in:
Simon McVittie 2007-07-11 21:30:41 +01:00
parent b01dbc5e75
commit 5ebcf5eda9

View File

@ -59,7 +59,7 @@ class LogWriter:
if msg[len(msg) - 1] != '\n': if msg[len(msg) - 1] != '\n':
msg += "\n" msg += "\n"
fmt = "%s - %s" % (level_txt, msg) fmt = "%.4f %s - %s" % (time.time(), level_txt, msg)
fmt = fmt.encode("utf8") fmt = fmt.encode("utf8")
self._log_file.write(fmt) self._log_file.write(fmt)
self._log_file.flush() self._log_file.flush()