diff options
author | Karel Kočí <cynerd@email.cz> | 2015-07-24 17:25:31 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2015-07-24 17:25:31 +0200 |
commit | a1aff4508bf0e87ecc4736a3a196a43faca3ffa1 (patch) | |
tree | fb7b0a131592f710e503a2246acca506fbd86c4c /scripts | |
parent | aa993b1a62314c45e5127b97ec131c8dc048a6fa (diff) | |
download | linux-conf-perf-a1aff4508bf0e87ecc4736a3a196a43faca3ffa1.tar.gz linux-conf-perf-a1aff4508bf0e87ecc4736a3a196a43faca3ffa1.tar.bz2 linux-conf-perf-a1aff4508bf0e87ecc4736a3a196a43faca3ffa1.zip |
Change log files position
Log files won't be in only one folder. Every program have its own folder.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/utils.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/utils.py b/scripts/utils.py index e3038e4..522a68d 100644 --- a/scripts/utils.py +++ b/scripts/utils.py @@ -58,8 +58,14 @@ def callsubprocess(process_name, process, show_output = True, return_output = False, env=os.environ, allowed_exit_codes = [0]): sprc = subprocess.Popen(process, stdout = subprocess.PIPE, env = env) + try: + os.mkdir(os.path.join(sf(conf.log_folder), process_name)) + except OSError: + pass + + rtn = [] with open(os.path.join(sf(conf.log_folder), - process_name + '-' + time.strftime("%y-%m-%d-%H-%M-%S") + ".log"), + process_name, time.strftime("%y-%m-%d-%H-%M-%S") + ".log"), "a") as f: f.write('::' + time.strftime("%y-%m-%d-%H-%M-%S-%f") + '::\n') for linen in sprc.stdout: |