irrad_control/gui/widgets/logging_widget.py
def change_level(self, level):
        """
        Change the logging level. Add or remove tabs / log consoles accordingly.
        """

        # If we're not changing to a new level, do nothing
        if level == self._loglevel:
            return

        self._loglevel = self._get_level_name(level)

        # Remove tab if new log level is higher than old
        if log_levels[self.tabs.tabText(0)] < log_levels[self._loglevel]:

            while log_levels[self.tabs.tabText(0)] < log_levels[self._loglevel]:
                _tab = self.tabs.tabText(0)
                self.tabs.removeTab(0)
                del self.log_consoles[_tab]
        # Add tabs
        else:
            # Make list of tabs to add
            tabs_to_add = [lvl for lvl in self.log_tabs if log_levels[lvl] >= log_levels[self._loglevel] and lvl not in self.log_consoles]

            # Add in reversed order since we're inserting at 0
            for tab in reversed(tabs_to_add):
                self.log_consoles[tab] = QtWidgets.QPlainTextEdit()
                self.log_consoles[tab].setReadOnly(True)
                self.tabs.insertTab(0, self.log_consoles[tab], tab)

        Change the logging level. Add or remove tabs / log consoles accordingly.
        
Change the logging level. Add or remove tabs / log consoles accordingly.
Change the logging level . Add or remove tabs / log consoles accordingly .
def change_level(self, level):
        if level == self._loglevel:
            return
        self._loglevel = self._get_level_name(level)
        if log_levels[self.tabs.tabText(0)] < log_levels[self._loglevel]:
            while log_levels[self.tabs.tabText(0)] < log_levels[self._loglevel]:
                _tab = self.tabs.tabText(0)
                self.tabs.removeTab(0)
                del self.log_consoles[_tab]
        else:
            tabs_to_add = [lvl for lvl in self.log_tabs if log_levels[lvl] >= log_levels[self._loglevel] and lvl not in self.log_consoles]
            for tab in reversed(tabs_to_add):
                self.log_consoles[tab] = QtWidgets.QPlainTextEdit()
                self.log_consoles[tab].setReadOnly(True)
                self.tabs.insertTab(0, self.log_consoles[tab], tab)
def change_level ( self , level ) : if level == self . _loglevel : return self . _loglevel = self . _get_level_name ( level ) if log_levels [ self . tabs . tabText ( 0 ) ] < log_levels [ self . _loglevel ] : while log_levels [ self . tabs . tabText ( 0 ) ] < log_levels [ self . _loglevel ] : _tab = self . tabs . tabText ( 0 ) self . tabs . removeTab ( 0 ) del self . log_consoles [ _tab ] else : tabs_to_add = [ lvl for lvl in self . log_tabs if log_levels [ lvl ] >= log_levels [ self . _loglevel ] and lvl not in self . log_consoles ] for tab in reversed ( tabs_to_add ) : self . log_consoles [ tab ] = QtWidgets . QPlainTextEdit ( ) self . log_consoles [ tab ] . setReadOnly ( True ) self . tabs . insertTab ( 0 , self . log_consoles [ tab ] , tab )
Change the logging level.
Change the logging level .
"""
        Change the logging level. Add or remove tabs / log consoles accordingly.
        """ # If we're not changing to a new level, do nothing # Remove tab if new log level is higher than old # Add tabs # Make list of tabs to add # Add in reversed order since we're inserting at 0
self
level