From 13fc232577971decc3bb2b28963afc2e7c97f010 Mon Sep 17 00:00:00 2001 From: Christoph Wiedemann <62332054+cwiede@users.noreply.github.com> Date: Tue, 4 Aug 2020 10:08:02 +0200 Subject: [PATCH] add option to completely disable the log --- nexxT/services/gui/GuiLogger.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/nexxT/services/gui/GuiLogger.py b/nexxT/services/gui/GuiLogger.py index 68eedca..d9a10c2 100644 --- a/nexxT/services/gui/GuiLogger.py +++ b/nexxT/services/gui/GuiLogger.py @@ -263,17 +263,9 @@ def __init__(self): self.actClear.triggered.connect(self.logWidget.clear) #self.actSingleLine.toggled.connect(self.logWidget.setUniformRowHeights) - self.actInternal = QAction("Internal") - self.actDebug = QAction("Debug") - self.actInfo = QAction("Info") - self.actWarning = QAction("Warning") - self.actError = QAction("Error") + self.actDisable = QAction("Disable") + self.actDisable.triggered.connect(self.setLogLevel) - self.actInternal.triggered.connect(lambda: mainLogger.setLevel(logging.INTERNAL)) - self.actDebug.triggered.connect(lambda: mainLogger.setLevel(logging.DEBUG)) - self.actInfo.triggered.connect(lambda: mainLogger.setLevel(logging.INFO)) - self.actWarning.triggered.connect(lambda: mainLogger.setLevel(logging.WARNING)) - self.actError.triggered.connect(lambda: mainLogger.setLevel(logging.ERROR)) self.actGroup = QActionGroup(self) self.actGroup.setExclusive(True) levelno = mainLogger.level @@ -292,6 +284,9 @@ def __init__(self): else: a.setChecked(False) logMenu.addAction(a) + self.loglevelMap[self.actDisable] = 100 + logMenu.addAction(self.actDisable) + logMenu.addSeparator() logMenu.addAction(self.actClear) logMenu.addAction(self.actFollow)