mirror of
https://github.com/jdegenstein/jmwright-CQ-Editor.git
synced 2025-12-20 22:47:06 +01:00
Reformat log output
This commit is contained in:
@@ -8,12 +8,14 @@ from ..mixins import ComponentMixin
|
|||||||
class QtLogHandler(logging.Handler,logging.StringFormatterHandlerMixin):
|
class QtLogHandler(logging.Handler,logging.StringFormatterHandlerMixin):
|
||||||
|
|
||||||
def __init__(self, log_widget,*args,**kwargs):
|
def __init__(self, log_widget,*args,**kwargs):
|
||||||
|
|
||||||
super(QtLogHandler,self).__init__(*args,**kwargs)
|
|
||||||
logging.StringFormatterHandlerMixin.__init__(self,None)
|
|
||||||
|
|
||||||
self.log_widget = log_widget
|
|
||||||
|
|
||||||
|
super(QtLogHandler,self).__init__(*args,**kwargs)
|
||||||
|
|
||||||
|
log_format_string = '[{record.time:%H:%M:%S.%f%z}] {record.level_name}: {record.message}'
|
||||||
|
|
||||||
|
logging.StringFormatterHandlerMixin.__init__(self,log_format_string)
|
||||||
|
self.log_widget = log_widget
|
||||||
|
|
||||||
def emit(self, record):
|
def emit(self, record):
|
||||||
|
|
||||||
msg = self.format(record)
|
msg = self.format(record)
|
||||||
@@ -40,4 +42,4 @@ class LogViewer(QPlainTextEdit, ComponentMixin):
|
|||||||
|
|
||||||
def append(self,msg):
|
def append(self,msg):
|
||||||
|
|
||||||
self.appendPlainText(msg)
|
self.appendPlainText(msg)
|
||||||
|
|||||||
Reference in New Issue
Block a user