10

I'm using KDE Plasma under Arch Linux and there are a lot of logs such as

kwin_x11[5129]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 11416, resource id: 56623191, major code: 20 (GetProperty), minor code: 0

in my journal.

These errors turned out to be harmless and I'd like to suppress them so that my journal doesn't get flooded. A popular solution I found was to set QT_LOGGING_RULES="*=false" but this disables logging completely even where it's actually useful.

I wonder how I can target only this Qt logging category and leave others untouched?

I've tried e.g. QT_LOGGING_RULES="qt.qpa.xcb.*=false" QT_LOGGING_RULES="qpa.xcb.*=false" QT_LOGGING_RULES="qt.*.xcb.*=false" etc but none of them worked.

2 Answers2

7

So far the best I could do:

export QT_LOGGING_RULES='*.debug=false;qt.qpa.*=false'
-1

As someone has pointed out in the previous answer, for some reason the syntax for specifying multiple rules via QT_LOGGING_RULES involving ; doesn't work on Ubuntu.

What worked for me was using QLoggingCategory::setFilterRules and using \n as separator for the individual rules for this to work. Extending on the previous answer: export QLoggingCategory::setFilterRules(QStringLiteral("*.debug=false\nqt.qpa.*=false"))