main
Ben Niemann 1 year ago
parent f44e3edbd4
commit fe0428e1cd

@ -182,11 +182,11 @@ class LogManager:
return handler
__qtLevelMap = {
QtCore.QtDebugMsg: logging.DEBUG,
QtCore.QtInfoMsg: logging.INFO,
QtCore.QtWarningMsg: logging.WARNING,
QtCore.QtCriticalMsg: logging.ERROR,
QtCore.QtFatalMsg: logging.CRITICAL,
QtCore.QtMsgType.QtDebugMsg: logging.DEBUG,
QtCore.QtMsgType.QtInfoMsg: logging.INFO,
QtCore.QtMsgType.QtWarningMsg: logging.WARNING,
QtCore.QtMsgType.QtCriticalMsg: logging.ERROR,
QtCore.QtMsgType.QtFatalMsg: logging.CRITICAL,
}
def __qtMessageHandler(
@ -203,12 +203,12 @@ class LogManager:
logger = logging.getLogger(loggerName)
record = logger.makeRecord(
name=loggerName,
level=self.__qtLevelMap[msg_type],
level=self.__qtLevelMap.get(msg_type, logging.ERROR),
fn=context.file,
lno=context.line,
msg=msg, args=(),
exc_info=None,
func=context.function)
logger.handle(record)
except:
except: # pylint: disable=bare-except
traceback.print_exc()

@ -101,7 +101,7 @@ class DeviceDB(QtCore.QAbstractListModel):
# TODO: remove when dynamic device updates get implemented.
# ('duplicate' devices are added when the jack backend gets restarted)
if idx < len(self.__devices) and self.__devices[idx].name == device.name:
return None
return
assert idx >= len(self.__devices) or self.__devices[idx].name != device.name, (
"Device {} already exists".format(device.name))

Loading…
Cancel
Save