use QLoggingCategory for logging
ClosedPublic

Authored by abondarenko on Dec 27 2019, 6:33 PM.

Details

Summary

Logging with QLoggingCategory instead of QtGlobal functions (qDebug, qInfo, etc)
allow users to filter out unwanted messages with kdebugsettings and qtlogging.ini

Diff Detail

Repository
R180 PIM: KMime
Lint
Lint Skipped
Unit
Unit Tests Skipped
abondarenko created this revision.Dec 27 2019, 6:33 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptDec 27 2019, 6:33 PM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
abondarenko requested review of this revision.Dec 27 2019, 6:33 PM
mlaurent requested changes to this revision.Dec 27 2019, 7:45 PM
mlaurent added a subscriber: mlaurent.
mlaurent added inline comments.
src/CMakeLists.txt
31

Why warning by default ?

if you add it you need to adapt kmime.categories for defining it (DEFAULT_SEVERITY [WARNING])

This revision now requires changes to proceed.Dec 27 2019, 7:45 PM

There is no reason for setting default logging level to Warning. Reset to default.

abondarenko marked an inline comment as done.Dec 28 2019, 8:29 AM

Removed DEVAULT_SEVERITY from CMakeLists.txt

mlaurent requested changes to this revision.Dec 28 2019, 2:57 PM
mlaurent added inline comments.
src/kmime_mdn.cpp
41 ↗(On Diff #72284)

Please remove QDebug as it's already define in kmime_debug.h

same for others files.

Thanks

This revision now requires changes to proceed.Dec 28 2019, 2:57 PM

Remove unused QDebug includes

abondarenko marked an inline comment as done.Dec 28 2019, 6:32 PM

I've removed unused QDebug except one in kmime_codecs.cpp. I don't have enough knowledge for it. When I'm trying to use KMIME_LOG in kmime_codecs.cpp, I get compile error in autotests.

mlaurent accepted this revision.Dec 29 2019, 8:40 AM

"I've removed unused QDebug except one in kmime_codecs.cpp. I don't have enough knowledge for it. When I'm trying to use KMIME_LOG in kmime_codecs.cpp, I get compile error in autotests." I will look at it after your commit.+

Thanks for doing it.

Do you have a commit access or you want that we commit for you ?

This revision is now accepted and ready to land.Dec 29 2019, 8:40 AM

No. I don't have commit access. Please commit it for me.

This revision was automatically updated to reflect the committed changes.