aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-07-24 10:44:31 +0200
committerKarel Kočí <cynerd@email.cz>2015-07-24 10:44:31 +0200
commit262545d80cdd3feba2d00071f5de048ed3f7a77a (patch)
treec31ff1f2845669fca1d7ea3a2d68c4982bcc2316
parent774d1f1e287a9face4b9dda707c49c24fe62074e (diff)
downloadlinux-conf-perf-262545d80cdd3feba2d00071f5de048ed3f7a77a.tar.gz
linux-conf-perf-262545d80cdd3feba2d00071f5de048ed3f7a77a.tar.bz2
linux-conf-perf-262545d80cdd3feba2d00071f5de048ed3f7a77a.zip
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.
-rw-r--r--scripts/utils.py3
1 files changed, 2 insertions, 1 deletions
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)