waveform: fix log messages

This commit is contained in:
Simon Renblad 2024-02-15 17:41:25 +08:00 committed by Sébastien Bourdeauducq
parent fc282d4e17
commit 6ed6fb0bce
1 changed files with 5 additions and 7 deletions

View File

@ -202,7 +202,7 @@ class _BaseWaveform(pg.PlotWidget):
try: try:
self.x_data, self.y_data = zip(*data) self.x_data, self.y_data = zip(*data)
except: except:
logger.error("Error getting data for waveform: {}".format(self.name), exc_info=True) logger.error("Error getting data for waveform: %s", self.name, exc_info=True)
def onCursorMove(self, x): def onCursorMove(self, x):
self.cursor.setValue(x) self.cursor.setValue(x)
@ -269,7 +269,7 @@ class BitWaveform(_BaseWaveform):
previous_y = y previous_y = y
self.plot_data_item.setData(x=display_x, y=display_y) self.plot_data_item.setData(x=display_x, y=display_y)
except: except:
logger.error('Error when displaying waveform: {}'.format(self.name), exc_info=True) logger.error("Error when displaying waveform: %s", self.name, exc_info=True)
for arw in self._arrows: for arw in self._arrows:
self.removeItem(arw) self.removeItem(arw)
self.plot_data_item.setData(x=[], y=[]) self.plot_data_item.setData(x=[], y=[])
@ -292,8 +292,7 @@ class AnalogWaveform(_BaseWaveform):
min_y = min(self.y_data) min_y = min(self.y_data)
self.plot_item.setRange(yRange=(min_y, max_y), padding=0.1) self.plot_item.setRange(yRange=(min_y, max_y), padding=0.1)
except: except:
logger.error( logger.error("Error when displaying waveform: %s", self.name, exc_info=True)
'Error when displaying waveform: {}'.format(self.name), exc_info=True)
self.plot_data_item.setData(x=[], y=[]) self.plot_data_item.setData(x=[], y=[])
def onCursorMove(self, x): def onCursorMove(self, x):
@ -348,8 +347,7 @@ class BitVectorWaveform(_BaseWaveform):
self._labels.append(lbl) self._labels.append(lbl)
self.plot_data_item.setData(x=display_x, y=display_y) self.plot_data_item.setData(x=display_x, y=display_y)
except: except:
logger.error( logger.error("Error when displaying waveform: %s", self.name, exc_info=True)
"Error when displaying waveform: {}".format(self.name), exc_info=True)
for lbl in self._labels: for lbl in self._labels:
self.plot_item.removeItem(lbl) self.plot_item.removeItem(lbl)
self.plot_data_item.setData(x=[], y=[]) self.plot_data_item.setData(x=[], y=[])
@ -394,7 +392,7 @@ class LogWaveform(_BaseWaveform):
self._labels.append(lbl) self._labels.append(lbl)
lbl.setPos(old_x, 1) lbl.setPos(old_x, 1)
except: except:
logger.error('Error when displaying waveform: {}'.format(self.name), exc_info=True) logger.error("Error when displaying waveform: %s", self.name, exc_info=True)
for lbl in self._labels: for lbl in self._labels:
self.plot_item.removeItem(lbl) self.plot_item.removeItem(lbl)
self.plot_data_item.setData(x=[], y=[]) self.plot_data_item.setData(x=[], y=[])