Commit c0f6a211 authored by Claudio Scafuri's avatar Claudio Scafuri 💬
Browse files

add exception log to stdout

parent 6f9abb92
......@@ -2436,8 +2436,7 @@ class FelMaster (tango.LatestDeviceImpl):
self.debug_stream('calc_new_delay_compensation centre: %s' % lambda_seed_0)
dly = self.delay_calc.get_compensation_delay(lambda_seed_0, lmb)
except Exception:
traceback.print_exc()
self.error_stream('Error calculating delay compensation')
self.error_stream('Error calculating delay compensation %s' % (traceback.format_exc()))
return dly
def select_hn_lmb(self, hn, lmb, mode=0):
......
......@@ -46,35 +46,31 @@ class opathread(threading.Thread):
self.master.error_stream('step 1: failed reading l0')
tango.Except.print_exception(e)
except Exception:
traceback.print_exc()
self.master.set_status('step 1: exception reading l0')
self.master.attr_LastSetOk = False
self.master.attr_LastSetMsg += 'step 1: exception reading l0\n'
self.master.error_stream('step 1: exception reading l0')
self.master.error_stream('step 1: exception reading l0 %s' % (traceback.format_exc()))
if self.master.delay_line_compensation_enabled:
if self.master.delay_line_compensation_enabled :
try:
delaycomp = self.master.delay_calc.get_compensation_delay(lmb0, self.lmb)
self.master.debug_stream(
'opathread step1: , lmb0, lmb, delaycomp %s %s %s' % (lmb0, self.lmb, delaycomp[0]))
except Exception:
traceback.print_exc()
self.master.set_status('step 1: exception calculating delay comp.')
self.master.attr_LastSetOk = False
self.master.attr_LastSetMsg += 'step 1: exception calculating delay comp.\n'
self.master.error_stream('step 1: exception calculating delay comp')
self.master.error_stream('step 1: exception calculating delay comp %s'% (traceback.format_exc()))
delaycomp[0] = 0.0 #in case of excpetion do not change delay line
# return
if self.master.set_compressor and self.master.compressor_calc :
try:
compressor_position = self.master.compressor_calc.get_position(self.lmb)
except Exception:
traceback.print_exc()
self.master.set_status('step 1: exception calculating compressor position.')
self.master.attr_LastSetOk = False
self.master.attr_LastSetMsg += 'step 1: exception calculating compressor position.\n'
self.master.error_stream('step 1: exception calculating compressor position')
self.master.error_stream('step 1: exception calculating compressor position %s' % (traceback.format_exc()))
# get if possible LTF status for stop an recover if needed
restart_LTF = False
if self.master.ltf != 0:
......@@ -118,10 +114,9 @@ class opathread(threading.Thread):
self.master.error_stream('failed reading pre sequencer state')
pre_state = tango.DevState.RUNNING #presume running...
except Exception:
traceback.print_exc()
self.master.set_status('failed reading pre sequencer state')
self.master.attr_LastSetMsg += 'failed reading pre sequencer state\n'
self.master.error_stream('failed reading pre sequencer state')
self.master.error_stream('failed reading pre sequencer state %s' % (traceback.format_exc()))
pre_state = tango.DevState.RUNNIG #presume running...
if pre_state == tango.DevState.RUNNING :
......@@ -167,8 +162,6 @@ class opathread(threading.Thread):
self.master.error_stream('step 2: failed setting compressor')
except Exception:
print 'line 731 -print_exc() postion=', compressor_position
traceback.print_exc()
self.master.error_stream('step 2 (583): %s' % (traceback.format_exc()))
self.master.set_status('step 2: exception setting compressor')
self.master.attr_LastSetOk = False
self.master.attr_LastSetMsg += 'step 2: exception setting compressro.\n'
......@@ -276,8 +269,6 @@ class opathread(threading.Thread):
self.master.attr_LastSetMsg += 'step 5: failed setting delay line\n'
self.master.error_stream('step 5: failed setting delay line')
except Exception:
traceback.print_exc()
self.master.error_stream('step 5 (794): %s' % (traceback.format_exc()))
self.master.set_status('step 5: exception setting delay comp.')
self.master.attr_LastSetOk = False
self.master.attr_LastSetMsg += 'step 5: exception setting delay comp.\n'
......@@ -296,11 +287,10 @@ class opathread(threading.Thread):
self.master.attr_LastSetOk = False
self.master.attr_LastSetMsg += 'step 6: PADRES spectrometer: no valid diffr. order\n'
except Exception:
traceback.print_exc()
self.master.set_status('step 6: failed adjusting PADRES spectrometer')
self.master.attr_LastSetOk = False
self.master.attr_LastSetMsg += 'step 6: failed adjusting PADRES spectrometer\n'
self.master.error_stream('step 6: failed adjusting PADRES spectrometer')
self.master.error_stream('step 6: failed adjusting PADRES spectrometer %s' % (traceback.format_exc()))
# restore LTF status if needed
if restart_LTF:
self.master.set_status('step 7: turning ON LTF...')
......@@ -369,10 +359,9 @@ class opathread(threading.Thread):
self.master.error_stream('failed reading post sequencer state')
post_state = tango.DevState.RUNNING #presume running...
except Exception:
traceback.print_exc()
self.master.set_status('failed reading post sequencer state')
self.master.attr_LastSetMsg += 'failed reading post sequencer state\n'
self.master.error_stream('failed reading post sequencer state')
self.master.error_stream('failed reading post sequencer state %s' % (traceback.format_exc()))
post_state = tango.DevState.RUNNIG #presume running...
if post_state == tango.DevState.RUNNING :
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment