Showing Qt debug messages in RHEL and derivatives

If you’re working with Qt and RHEL 7.x (or any derivatives) you may have come across a bug where qDebug messages do not show up. According to this post in RedHat’s bug tracker, looks like the default logging settings are quite restrictive “[…] by design. Our users do not want to get spammed with debugging output”. You can check it by yourself at /usr/share/qt5/qtlogging.ini

[Rules]
*.debug=false

The solution is pretty simple. According to the official Qt docs, you can override the settings in that file by creating your own at ~/.config/QtProject/qtlogging.ini. Mine looks like this:

[Rules]
*.debug=true
qt.*.debug=false

That shows all debug messages except those from Qt’s internal code.
 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.