Multiline logs in gui
This commit is contained in:
parent
02ec988f90
commit
979e1d385e
1 changed files with 4 additions and 1 deletions
|
@ -801,10 +801,13 @@ class SyngGui(QMainWindow):
|
||||||
class LoggingLabelHandler(logging.Handler):
|
class LoggingLabelHandler(logging.Handler):
|
||||||
def __init__(self, label: QLabel):
|
def __init__(self, label: QLabel):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
self.loglines = []
|
||||||
self.label = label
|
self.label = label
|
||||||
|
|
||||||
def emit(self, record: logging.LogRecord) -> None:
|
def emit(self, record: logging.LogRecord) -> None:
|
||||||
self.label.setText(self.format(record))
|
self.loglines.append(self.format(record))
|
||||||
|
self.loglines = self.loglines[-5:]
|
||||||
|
self.label.setText("\n".join(self.loglines))
|
||||||
|
|
||||||
|
|
||||||
def run_gui() -> None:
|
def run_gui() -> None:
|
||||||
|
|
Loading…
Add table
Reference in a new issue