From 6ed6fb0bce1a9a52cd7426e7e1239143f4ed785a Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Thu, 15 Feb 2024 17:41:25 +0800 Subject: [PATCH] waveform: fix log messages --- artiq/dashboard/waveform.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/artiq/dashboard/waveform.py b/artiq/dashboard/waveform.py index 97d07576e..ef15b41b9 100644 --- a/artiq/dashboard/waveform.py +++ b/artiq/dashboard/waveform.py @@ -202,7 +202,7 @@ class _BaseWaveform(pg.PlotWidget): try: self.x_data, self.y_data = zip(*data) 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): self.cursor.setValue(x) @@ -269,7 +269,7 @@ class BitWaveform(_BaseWaveform): previous_y = y self.plot_data_item.setData(x=display_x, y=display_y) 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: self.removeItem(arw) self.plot_data_item.setData(x=[], y=[]) @@ -292,8 +292,7 @@ class AnalogWaveform(_BaseWaveform): min_y = min(self.y_data) self.plot_item.setRange(yRange=(min_y, max_y), padding=0.1) 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) self.plot_data_item.setData(x=[], y=[]) def onCursorMove(self, x): @@ -348,8 +347,7 @@ class BitVectorWaveform(_BaseWaveform): self._labels.append(lbl) self.plot_data_item.setData(x=display_x, y=display_y) 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: self.plot_item.removeItem(lbl) self.plot_data_item.setData(x=[], y=[]) @@ -394,7 +392,7 @@ class LogWaveform(_BaseWaveform): self._labels.append(lbl) lbl.setPos(old_x, 1) 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: self.plot_item.removeItem(lbl) self.plot_data_item.setData(x=[], y=[])