From 0ae1d966c3089c87381bac216dce209e4ecebe2d Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Thu, 13 Nov 2014 12:30:54 +1100 Subject: [PATCH] Change log_file_name to add _date for sct driver logfiles --- site_ansto/instrument/util/gen_sct.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/site_ansto/instrument/util/gen_sct.py b/site_ansto/instrument/util/gen_sct.py index ac2ae8bf..2285a95b 100755 --- a/site_ansto/instrument/util/gen_sct.py +++ b/site_ansto/instrument/util/gen_sct.py @@ -1086,9 +1086,12 @@ def put_preamble(MyDriver): txt += [' set catch_status [ catch {'] txt += [' set debug_threshold [hgetpropval ${tc_root} debug_threshold]'] txt += [' if {${debug_level} >= ${debug_threshold}} {'] - txt += [' set fd [open "../log/%s_[basename ${tc_root}].log" "a"]' % MyDriver['name']] - txt += [' set line "[clock format [clock seconds] -format "%T"] ${debug_string}"'] - txt += [' puts ${fd} "${line}"'] + txt += [' set now [clock seconds]'] + txt += [' set ts [clock format ${now} -format "%Y%m%d"]'] + txt += [' set log_file_name "../log/%s_[basename ${tc_root}]_${ts}.log"' % MyDriver['name']] + txt += [' set fd [open "${log_file_name}" "a"]'] + txt += [' set ts [clock format ${now} -format "%T"]'] + txt += [' puts ${fd} "${ts} ${debug_string}"'] txt += [' close ${fd}'] txt += [' }'] txt += [' } catch_message ]']