diff --git a/site_ansto/instrument/util/gen_sct.py b/site_ansto/instrument/util/gen_sct.py index ca69520b..229cf991 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 ]']