From 262545d80cdd3feba2d00071f5de048ed3f7a77a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 24 Jul 2015 10:44:31 +0200 Subject: Return timestamp to subprocess execution log When script is running, this function could be executed multiple times in same second. If it would happen, it wouldn't be easy find where starts which execution. --- scripts/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/utils.py b/scripts/utils.py index 0d7f67a..2c20262 100644 --- a/scripts/utils.py +++ b/scripts/utils.py @@ -62,7 +62,8 @@ def callsubprocess(process_name, process, show_output = True, regular = "", rtn = "" with open(os.path.join(sf(conf.log_folder), process_name + '-' + time.strftime("%y-%m-%d-%H-%M-%S") + ".log"), - "w") as f: + "a") as f: + f.write('::' + time.strftime("%y-%m-%d-%H-%M-%S-%f") + '::') for linen in sprc.stdout: line = linen.decode(sys.getdefaultencoding()) f.write(line) -- cgit v1.2.3