Only get requests had a debug output
Details
compiled an verifies with test app
Diff Detail
- Repository
- R235 Attica
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Straight-up qDebug would cause quite a lot of spam... I'd be much happier if this was done using qCDebug (which is already used in other parts of the code, so just need to include attica_debug.h and swap for qDebug for qCDebug(ATTICA))
Unfortunally changing to qCDebug will not show any debug messages in the provider test app.
I can only see debug messages if I change in the top level CMakeLists.txt the line
ecm_qt_declare_logging_category(attica_SRCS HEADER attica_debug.h IDENTIFIER ATTICA CATEGORY_NAME org.kde.attica)
to
ecm_qt_declare_logging_category(attica_SRCS HEADER attica_debug.h IDENTIFIER ATTICA CATEGORY_NAME org.kde.attica DEFAULT_SEVERITY Debug)
Any hint how to do that programmatically in the provider test app ? http://doc.qt.io/qt-5/qloggingcategory.html#details gave no usable hint
Actually, it does. You have to enable logging explicitly for the per default excluded levels:
org.kde.attica.debug=true
http://doc.qt.io/qt-5/qloggingcategory.html#configuring-categories
http://doc.qt.io/qt-5/qloggingcategory.html#setFilterRules
Thanks for this pointer. After looking at http://blog.qt.io/blog/2014/03/11/qt-weekly-1-categorized-logging/, which shows a an example for an application I got this working.
Will fix that.
BTW:You are aware, that there are still much usage of qDebug in attica code ?
~/src/attica> grep -rn qDebug\(\) | wc -l 82 ~/src/attica/src> grep -rn qDebug\(\) | wc -l 40
Just on question relating the category: Is there something comparable to KDebugDialog and kdebug.areas from KDE4 times https://cgit.kde.org/kdelibs.git/tree/kdecore/kdebug.areas?h=KDE/4.14, which did make it easy to enable/disable debug message for multiple components. I'm asking because, if not, with having `ecm_qt_declare_logging_category``` it would be easy to create and install a related file, which could be used by a KF5 related KF5DebugDialog.
kdebugsettings is what you are looking for, it works for all Qt applications. You can specify the rules directly, or use the available .categories file to quickly select some levels.
Many applications by KDE exports a .categories file. There was an effort to automatically generate it but was dropped: https://phabricator.kde.org/D9446