Just change level to DEBUG with suppressed Qt messages
This commit is contained in:
parent
eb426cb870
commit
5e6cddecaf
@ -130,12 +130,15 @@ def qt_message_handler(msg_type, context, msg):
|
|||||||
QtCriticalMsg: logging.ERROR,
|
QtCriticalMsg: logging.ERROR,
|
||||||
QtFatalMsg: logging.CRITICAL,
|
QtFatalMsg: logging.CRITICAL,
|
||||||
}
|
}
|
||||||
# Suppress some messages because they're well-known.
|
# Change levels of some well-known messages to debug so they don't get
|
||||||
|
# shown to the user.
|
||||||
suppressed_msgs = ["libpng warning: iCCP: Not recognizing known sRGB "
|
suppressed_msgs = ["libpng warning: iCCP: Not recognizing known sRGB "
|
||||||
"profile that has been edited",
|
"profile that has been edited",
|
||||||
"OpenType support missing for script 19"]
|
"OpenType support missing for script 19"]
|
||||||
if msg.strip() in suppressed_msgs:
|
if msg.strip() in suppressed_msgs:
|
||||||
return
|
level = logging.DEBUG
|
||||||
|
else:
|
||||||
|
level = qt_to_logging[msg_type]
|
||||||
# We get something like "void qt_png_warning(png_structp, png_const_charp)"
|
# We get something like "void qt_png_warning(png_structp, png_const_charp)"
|
||||||
# from Qt, but only want "qt_png_warning".
|
# from Qt, but only want "qt_png_warning".
|
||||||
match = re.match(r'.* (\w*)\(.*\)', context.function)
|
match = re.match(r'.* (\w*)\(.*\)', context.function)
|
||||||
@ -144,8 +147,8 @@ def qt_message_handler(msg_type, context, msg):
|
|||||||
else:
|
else:
|
||||||
func = context.function
|
func = context.function
|
||||||
name = 'qt' if context.category == 'default' else 'qt-' + context.category
|
name = 'qt' if context.category == 'default' else 'qt-' + context.category
|
||||||
record = qt.makeRecord(name, qt_to_logging[msg_type], context.file,
|
record = qt.makeRecord(name, level, context.file, context.line, msg, None,
|
||||||
context.line, msg, None, None, func)
|
None, func)
|
||||||
qt.handle(record)
|
qt.handle(record)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user