Best way to display logs in pyqt?
Adapted from Todd Vanyo‘s example for PyQt5: import sys from PyQt5 import QtWidgets import logging # Uncomment below for terminal log messages # logging.basicConfig(level=logging.DEBUG, format=” %(asctime)s – %(name)s – %(levelname)s – %(message)s”) class QTextEditLogger(logging.Handler): def __init__(self, parent): super().__init__() self.widget = QtWidgets.QPlainTextEdit(parent) self.widget.setReadOnly(True) def emit(self, record): msg = self.format(record) self.widget.appendPlainText(msg) class MyDialog(QtWidgets.QDialog, QtWidgets.QPlainTextEdit): def __init__(self, parent=None): … Read more