Add localtime also to early log messages
authorClifford Wolf <clifford@clifford.at>
Sun, 11 Mar 2018 00:26:40 +0000 (01:26 +0100)
committerClifford Wolf <clifford@clifford.at>
Sun, 11 Mar 2018 00:26:40 +0000 (01:26 +0100)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
sbysrc/sby.py

index 1a24841279679b3591a484f2946a14c8315fc900..e77c571492f939e0ff2f0eeb49e565377e9774d4 100644 (file)
@@ -20,6 +20,7 @@
 import os, sys, getopt, shutil, tempfile
 ##yosys-sys-path##
 from sby_core import SbyJob
+from time import localtime
 
 sbyfile = None
 workdir = None
@@ -101,7 +102,8 @@ if len(args) > 1:
 early_logmsgs = list()
 
 def early_log(workdir, msg):
-    early_logmsgs.append("SBY [%s] %s" % (workdir, msg))
+    tm = localtime()
+    early_logmsgs.append("SBY %2d:%02d:%02d [%s] %s" % (tm.tm_hour, tm.tm_min, tm.tm_sec, workdir, msg))
     print(early_logmsgs[-1])