Cleanup for ignored log messages.

This commit is contained in:
Florian Bruhin 2015-09-09 22:53:37 +02:00
parent d217fe09c6
commit bcee12853d

View File

@ -256,29 +256,32 @@ def qt_message_handler(msg_type, context, msg):
except AttributeError: except AttributeError:
# Qt < 5.5 # Qt < 5.5
pass pass
# Change levels of some well-known messages to debug so they don't get # Change levels of some well-known messages to debug so they don't get
# shown to the user. # shown to the user.
# suppressed_msgs is a list of regexes matching the message texts to hide. #
# If a message starts with any text in suppressed_msgs, it's not logged as
# error.
suppressed_msgs = [ suppressed_msgs = [
# PNGs in Qt with broken color profile # PNGs in Qt with broken color profile
# https://bugreports.qt.io/browse/QTBUG-39788 # https://bugreports.qt.io/browse/QTBUG-39788
"libpng warning: iCCP: Not recognizing known sRGB profile that has " 'libpng warning: iCCP: Not recognizing known sRGB profile that has '
"been edited", 'been edited',
# Hopefully harmless warning # Hopefully harmless warning
"OpenType support missing for script ", 'OpenType support missing for script ',
# Error if a QNetworkReply gets two different errors set. Harmless Qt # Error if a QNetworkReply gets two different errors set. Harmless Qt
# bug on some pages. # bug on some pages.
# https://bugreports.qt.io/browse/QTBUG-30298 # https://bugreports.qt.io/browse/QTBUG-30298
"QNetworkReplyImplPrivate::error: Internal problem, this method must " 'QNetworkReplyImplPrivate::error: Internal problem, this method must '
"only be called once.", 'only be called once.',
# Sometimes indicates missing text, but most of the time harmless # Sometimes indicates missing text, but most of the time harmless
"load glyph failed ", 'load glyph failed ',
# Harmless, see https://bugreports.qt.io/browse/QTBUG-42479 # Harmless, see https://bugreports.qt.io/browse/QTBUG-42479
"content-type missing in HTTP POST, defaulting to " 'content-type missing in HTTP POST, defaulting to '
"application/x-www-form-urlencoded. Use QNetworkRequest::setHeader() " 'application/x-www-form-urlencoded. '
"to fix this problem.", 'Use QNetworkRequest::setHeader() to fix this problem.',
# https://bugreports.qt.io/browse/QTBUG-43118 # https://bugreports.qt.io/browse/QTBUG-43118
"Using blocking call!", 'Using blocking call!',
# Hopefully harmless # Hopefully harmless
'"Method "GetAll" with signature "s" on interface ' '"Method "GetAll" with signature "s" on interface '
'"org.freedesktop.DBus.Properties" doesn\'t exist', '"org.freedesktop.DBus.Properties" doesn\'t exist',
@ -292,9 +295,10 @@ def qt_message_handler(msg_type, context, msg):
] ]
if sys.platform == 'darwin': if sys.platform == 'darwin':
suppressed_msgs += [ suppressed_msgs += [
"libpng warning: iCCP: known incorrect sRGB profile", 'libpng warning: iCCP: known incorrect sRGB profile',
"virtual void QSslSocketBackendPrivate::transmit() SSLRead failed " # https://bugreports.qt.io/browse/QTBUG-47154
"with: -9805", 'virtual void QSslSocketBackendPrivate::transmit() SSLRead failed '
'with: -9805',
] ]
if any(msg.strip().startswith(pattern) for pattern in suppressed_msgs): if any(msg.strip().startswith(pattern) for pattern in suppressed_msgs):