Bug 390752 - Kdebugsettings overwrites default debug level for all log categories
Summary: Kdebugsettings overwrites default debug level for all log categories
Status: RESOLVED FIXED
Alias: None
Product: kdebugsettings
Classification: Applications
Component: general (show other bugs)
Version: 17.12.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Laurent Montel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-19 19:15 UTC by Stefan Brüns
Modified: 2018-03-03 23:53 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 18.04.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Brüns 2018-02-19 19:15:58 UTC
As can be seen from the output of
https://lxr.kde.org/search?_filestring=frameworks&_string=Q_LOGGING_CATEGORY

the default log level for different debug categories varies from QtCriticalMsg to QtInfoMsg.

As soon as kdebugsettings is started and either Apply or Ok is clicked, the log level for all categories is set to QtInfoMsg.

1. For each of the ~300 categories 4 rules are created, >= 1200 rules in total

2. The only possibility to reset the log levels is by deleting ~/.config/QtProject/qtlogging.ini

3. Setting the log level to QtInfoMsg increases the log level for every category which defaults to Critical or Warning

4. it lowers the log level for categories defaulting to Debug
Comment 1 Laurent Montel 2018-02-20 05:53:43 UTC
"As can be seen from the output of
https://lxr.kde.org/search?_filestring=frameworks&_string=Q_LOGGING_CATEGORY

the default log level for different debug categories varies from QtCriticalMsg to QtInfoMsg."

all module which doesn't use debug categories files will not override by kdebugsettings => so kdebugsettings will not change settings for these modules.

But indeed it will change settings for other modules.

But default all module uses same settings generated by categories ecm macro.

=> QtInfoMsg

see  #if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
Q_LOGGING_CATEGORY(RUQOLA_DDPAPI_COMMAND_LOG, "org.kde.ruqola.ddpapi.command", QtInfoMsg)
#else
Q_LOGGING_CATEGORY(RUQOLA_DDPAPI_COMMAND_LOG, "org.kde.ruqola.ddpapi.command")
#endif

"
=> it's normal. 

"
3. Setting the log level to QtInfoMsg increases the log level for every category which defaults to Critical or Warning"

it's wrong as we can't change settings from module which doesn't use debug categories file.

"4. it lowers the log level for categories defaulting to Debug" wrong too.
Comment 2 Stefan Brüns 2018-02-20 15:39:42 UTC
(In reply to Laurent Montel from comment #1)
> "As can be seen from the output of
> https://lxr.kde.org/search?_filestring=frameworks&_string=Q_LOGGING_CATEGORY
> 
> the default log level for different debug categories varies from
> QtCriticalMsg to QtInfoMsg."
> 
> all module which doesn't use debug categories files will not override by
> kdebugsettings => so kdebugsettings will not change settings for these
> modules.
> 
> But indeed it will change settings for other modules.
> 
> But default all module uses same settings generated by categories ecm macro.
> 
> => QtInfoMsg
> 
> see  #if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
> Q_LOGGING_CATEGORY(RUQOLA_DDPAPI_COMMAND_LOG,
> "org.kde.ruqola.ddpapi.command", QtInfoMsg)
> #else
> Q_LOGGING_CATEGORY(RUQOLA_DDPAPI_COMMAND_LOG,
> "org.kde.ruqola.ddpapi.command")
> #endif
> 
> "
> => it's normal. 

grep kf5.kio.kio_http  /etc/xdg/*categories
/etc/xdg/kde.categories:kf5.kio.kio_http KIO HTTP slave (KIO)

https://lxr.kde.org/source/frameworks/kio/src/ioslaves/http/http.cpp#0080
0080 Q_LOGGING_CATEGORY(KIO_HTTP, "kf5.kio.kio_http", QtWarningMsg) // disable debug by default

> "
> 3. Setting the log level to QtInfoMsg increases the log level for every
> category which defaults to Critical or Warning"
> 
> it's wrong as we can't change settings from module which doesn't use debug
> categories file.

See above - even modules with categories file have deviating settings.
Comment 3 Laurent Montel 2018-02-20 15:59:04 UTC
(In reply to Stefan Brüns from comment #2)
> (In reply to Laurent Montel from comment #1)
> > "As can be seen from the output of
> > https://lxr.kde.org/search?_filestring=frameworks&_string=Q_LOGGING_CATEGORY
> > 
> > the default log level for different debug categories varies from
> > QtCriticalMsg to QtInfoMsg."
> > 
> > all module which doesn't use debug categories files will not override by
> > kdebugsettings => so kdebugsettings will not change settings for these
> > modules.
> > 
> > But indeed it will change settings for other modules.
> > 
> > But default all module uses same settings generated by categories ecm macro.
> > 
> > => QtInfoMsg
> > 
> > see  #if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
> > Q_LOGGING_CATEGORY(RUQOLA_DDPAPI_COMMAND_LOG,
> > "org.kde.ruqola.ddpapi.command", QtInfoMsg)
> > #else
> > Q_LOGGING_CATEGORY(RUQOLA_DDPAPI_COMMAND_LOG,
> > "org.kde.ruqola.ddpapi.command")
> > #endif
> > 
> > "
> > => it's normal. 
> 
> grep kf5.kio.kio_http  /etc/xdg/*categories
> /etc/xdg/kde.categories:kf5.kio.kio_http KIO HTTP slave (KIO)
> 
> https://lxr.kde.org/source/frameworks/kio/src/ioslaves/http/http.cpp#0080
> 0080 Q_LOGGING_CATEGORY(KIO_HTTP, "kf5.kio.kio_http", QtWarningMsg) //
> disable debug by default

So it's a bug in this package.
We must create a categories file if we don't use generated categories file
otherwise it's impossible to which type of warning is setting.



> 
> > "
> > 3. Setting the log level to QtInfoMsg increases the log level for every
> > category which defaults to Critical or Warning"
> > 
> > it's wrong as we can't change settings from module which doesn't use debug
> > categories file.
> 
> See above - even modules with categories file have deviating settings.
Comment 4 Laurent Montel 2018-02-21 12:24:14 UTC
I looked how to implement it.
I will do soon.
But I need to fix categories files.
Comment 5 Laurent Montel 2018-02-21 15:00:10 UTC
Fixed in 18.04.0
Comment 6 Laurent Montel 2018-02-22 08:40:02 UTC
Git commit 7aff08c1fc1f4605ed37659b4b13e91177e16fd3 by Laurent Montel.
Committed on 21/02/2018 at 12:24.
Pushed by mlaurent into branch 'master'.

Fix Bug 390752 - Kdebugsettings overwrites default debug level for all log categories

FIXED-IN: 18.04.0

M  +14   -0    autotests/categorytypecomboboxtest.cpp
M  +2    -0    autotests/categorytypecomboboxtest.h
M  +35   -3    autotests/kdebugsettingutiltest.cpp
M  +4    -0    autotests/kdebugsettingutiltest.h
M  +1    -1    data/kde.categories
M  +10   -0    src/categorytypecombobox.cpp
M  +2    -0    src/categorytypecombobox.h
M  +7    -2    src/kdeapplicationtreelistwidget.cpp
M  +1    -0    src/kdeapplicationtreelistwidget.h
M  +1    -0    src/kdebugsettingsdialog.cpp
M  +19   -1    src/kdebugsettingsutil.cpp
M  +1    -0    src/kdebugsettingsutil.h
M  +5    -2    src/loadcategoriesjob.cpp
M  +3    -3    src/loggingcategory.cpp
M  +3    -2    src/loggingcategory.h

https://commits.kde.org/kdebugsettings/7aff08c1fc1f4605ed37659b4b13e91177e16fd3
Comment 7 Stefan Brüns 2018-03-03 23:53:24 UTC
Thanks a lot!
I saw you also made some adjustments to qDebug usage in kdepim and oauth, very welcome as well!