Bug 414028 - digikam spamming journal with details of almost everything it does...
Summary: digikam spamming journal with details of almost everything it does...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Portability-Runtime (other bugs)
Version First Reported In: 6.4.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-11 13:57 UTC by Paul
Modified: 2020-01-09 05:43 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.0.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul 2019-11-11 13:57:06 UTC
SUMMARY

Digikam is writing *lots* of (probably unnecessary) data to the journal.

Simply launching and then immediately closing digikam results in approx 65k being written.

STEPS TO REPRODUCE
1. (Note time.)
2. Launch digikam
3. Close digikam
4. (Note time.)
4. 'grep' journal for 'digikam' entries within time frame 

OBSERVED RESULT
In excess of 65k written. (This almost looks like a debug level write...)

EXPECTED RESULT
Minimal writes to the journal.

SOFTWARE/OS VERSIONS
digikam 6.4.0
Operating System: openSUSE Tumbleweed 20191109
KDE Plasma Version: 5.17.2
KDE Frameworks Version: 5.63.0
Qt Version: 5.13.1
Kernel Version: 5.3.8-1-default


ADDITIONAL INFORMATION
Comment 1 caulier.gilles 2019-11-11 14:00:42 UTC
digiKam do not write anything in system journal.

It's a wrong Qt logging configuration in your system which trace all application debug trace in journal. This kind of information must only going to the console for debug purpose.

So, OpenSuse has setup a wrong qtlogging.ini file in the system. Please report this as UPSTREAM to OpenSuse team.

Gilles Caulier
Comment 2 Paul 2019-11-11 14:21:11 UTC
(In reply to caulier.gilles from comment #1)
> 
> So, OpenSuse has setup a wrong qtlogging.ini file in the system. Please
> report this as UPSTREAM to OpenSuse team.
> 
> Gilles Caulier

OK. - Thanks.

https://bugzilla.opensuse.org/show_bug.cgi?id=1156452
Comment 3 Fabian Vogt 2019-11-11 16:10:14 UTC
In the code it's visible that DigiKam logs messages of all categories (even debug) by default: https://github.com/KDE/digikam/blob/f2064042324ec67392d815686e8e2908a10135c0/core/app/utils/digikam_debug.cpp#L28

Quoting the Qt documentation:

> Q_LOGGING_CATEGORY(name, string)
> Defines a logging category name, and makes it configurable under the string identifier. By default, all message types are enabled.

DigiKam needs to use

> Q_LOGGING_CATEGORY(name, string, msgType)
> Defines a logging category name, and makes it configurable under the string identifier. By default, messages of QtMsgType msgType and more severe are enabled, types with a lower severity are disabled.

instead.
Comment 4 Christophe Marin 2019-11-11 16:32:05 UTC
or even better, use ECMQtDeclareLoggingCategory.
Comment 5 Maik Qualmann 2019-11-12 08:10:49 UTC
*** Bug 414016 has been marked as a duplicate of this bug. ***
Comment 6 MarcP 2019-11-12 10:46:30 UTC
Also affects Ubuntu 18.04 LTS.
Comment 7 caulier.gilles 2020-01-05 06:16:42 UTC
*** Bug 415882 has been marked as a duplicate of this bug. ***
Comment 8 caulier.gilles 2020-01-05 06:49:52 UTC
Git commit 9be588f6902e0410f96e03ed258821f440ed29f0 by Gilles Caulier.
Committed on 05/01/2020 at 06:46.
Pushed by cgilles into branch 'master'.

log all debug messages as info types by default to not bloat log files under linux system with qt/syslog re-routed categories

M  +23   -23   core/app/utils/digikam_debug.cpp

https://invent.kde.org/kde/digikam/commit/9be588f6902e0410f96e03ed258821f440ed29f0
Comment 9 caulier.gilles 2020-01-05 06:57:35 UTC
Git commit 7a78ff4f13ee6ce63396b7a2eea6c21d2fd08660 by Gilles Caulier.
Committed on 05/01/2020 at 06:56.
Pushed by cgilles into branch 'master'.

add note to AppImage start script about to enbale all debug traces on the console

M  +2    -1    project/bundles/appimage/data/AppRun

https://invent.kde.org/kde/digikam/commit/7a78ff4f13ee6ce63396b7a2eea6c21d2fd08660
Comment 10 caulier.gilles 2020-01-05 07:40:13 UTC
Git commit d7084ffc9c54195920f23e7ddeb3b14bb50d6683 by Gilles Caulier.
Committed on 05/01/2020 at 07:38.
Pushed by cgilles into branch 'dev'.

Website: For Linux and MacOS, add details about how to turn on debug tarce on the console with QT_LOGGING_RULES env. var.

M  +12   -0    content/contribute/_index.md

https://invent.kde.org/websites/digikam-org/commit/d7084ffc9c54195920f23e7ddeb3b14bb50d6683
Comment 11 caulier.gilles 2020-01-05 07:58:54 UTC
Git commit f1bcc6778048fbb45e4162e01749ad3e59a9857c by Gilles Caulier.
Committed on 05/01/2020 at 07:57.
Pushed by cgilles into branch 'master'.

Add new static method to customized a force list of debug space at run time if necessary.
By default all traces are enabled under Windows, as messages are caugth by an extra application as DebugView
Under Linux and MacOS, message are dispatched automatically to the console and can be tune with QT_LOGGING_RULES env. var.

M  +2    -0    core/app/main/main.cpp
M  +8    -0    core/app/utils/digikam_debug.cpp
M  +5    -0    core/app/utils/digikam_debug.h
M  +2    -0    core/showfoto/main/main.cpp

https://invent.kde.org/kde/digikam/commit/f1bcc6778048fbb45e4162e01749ad3e59a9857c
Comment 12 caulier.gilles 2020-01-05 21:39:46 UTC
digiKam AppImage 7.0.0-beta2 64 bits is updated with last changes to reduce QtLogging data stream at run-time.

File can be downloaded at this place for testing :

https://files.kde.org/digikam/

Can you reproduce the problem with this version ?

Thanks in advance

Gilles Caulier
Comment 13 MarcP 2020-01-06 11:59:06 UTC
I just realized I replied to the duplicated bug file, so let me link that comment here too, since it is still relevant:

https://bugs.kde.org/show_bug.cgi?id=414016#c13

(Basically, the bug is still relevant in digikam 7.0.0 beta2)
Comment 14 caulier.gilles 2020-01-07 08:39:09 UTC
Git commit bd7adde1afc349cad5001687846ee31af766d0c7 by Gilles Caulier.
Committed on 07/01/2020 at 08:37.
Pushed by cgilles into branch 'master'.

digiKam AppImage: Drop Qt core debug traces dispatched by Qt Logging categories
Related: bug 414016, bug 415882

M  +3    -0    project/bundles/appimage/data/AppRun

https://invent.kde.org/kde/digikam/commit/bd7adde1afc349cad5001687846ee31af766d0c7
Comment 15 caulier.gilles 2020-01-08 08:26:52 UTC
Git commit e613bc900c58144256e6d24e463217dabe76e495 by Gilles Caulier.
Committed on 08/01/2020 at 08:22.
Pushed by cgilles into branch 'master'.

This is a mess: some qWarning(), qInfo(), qCritical() messages are not wrapped in litteral debug spaces as expected
and are printed as "unknown". To disable these messages, the right keyword is "default" (it's logic of course!)
Now AppImage do not export the huge warning strings from Qt core in log files. ouf...
Related: bug 415882, bug 414016

M  +1    -1    project/bundles/appimage/data/AppRun

https://invent.kde.org/kde/digikam/commit/e613bc900c58144256e6d24e463217dabe76e495