Default to disabled debug log on Q_LOGGING_CATEGORY calls
ClosedPublic

Authored by kossebau on Apr 30 2017, 1:46 PM.

Details

Summary

This removes the need to call QLoggingCategory::setFilterRules()
in the program code to default to disabled debug type log
without any other settings.
The latter has disadvantages, as it shadows any settings done
in qtlogging.ini config files by the user
(e.g. via kdebugsettings), thus enabling runtime control only
via QT_LOGGING_CONF/QT_LOGGING_RULES, which is not that
comfortable with lots of categories.

Also use ECMQtDeclareLoggingCategory for less manual code

While there can be some inconsistency with the default disabled
log categories by ECMQtDeclareLoggingCategory, which
switched to QtInfoMsg for ECM 5.26 (when KF5 5.26 has Qt 5.5
as min dep, which is the Qt version QtInfoMsg was added),
current KDevPlatform code has Qt 5.4 as minimum version and
thus also does not use qCInfo, so KDevPlatform behaviour should
be the same across used Qt versions.

Diff Detail

Repository
R33 KDevPlatform
Branch
useECMQtDeclareLoggingCategory
Lint
No Linters Available
Unit
No Unit Test Coverage
kossebau created this revision.Apr 30 2017, 1:46 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptApr 30 2017, 1:46 PM

Target is 5.1

Patch does not yet cover all the categories in the plugins, first wanted to get feedback.

If change is okay by concept, okay to commit directly with patch extended also for plugins, or do you first want to review those as well?
Adaptions to plugins should be the same as for the libs.

apol added a subscriber: apol.May 8 2017, 9:56 PM

I don't see why this should go to 5.1.

+1 to the change though, I am actually using it in the runtimes patches in fact.

*shameless plug: sudo review my patches, please, the delta is growning and growing*

kossebau updated this revision to Diff 14336.May 9 2017, 11:30 AM

adapt also all plugins

In D5666#108252, @apol wrote:

I don't see why this should go to 5.1.

Motivation was that this might, together with D5663, simplify life for users trying to help with debugging their issues on 5.1 already. Actually I was triggered by someone trying to control debug output for 5.1 :)

+1 to the change though, I am actually using it in the runtimes patches in fact.

Okay, so completed patch now for this repo.

*shameless plug: sudo review my patches, please, the delta is growning and growing*

Yes, yes... I know your pain...

BTW, using a generic "debug.h" might not be the best header name here, given there are lots of these headers floating around in the visible source path (and then some in system include dirs). But that is left for someone else/some other time.

kfunk accepted this revision.May 10 2017, 2:10 PM
This revision is now accepted and ready to land.May 10 2017, 2:10 PM
kossebau closed this revision.May 17 2017, 11:44 AM

Closing manually,as phab seems to have not properly swallowed the landed commit itself ("still importing" after days).