Use logging category for some qDebugs

This commit is contained in:
Tobias Fella
2025-08-24 10:07:59 +02:00
parent 2c09a48c8d
commit 026db80391
2 changed files with 11 additions and 2 deletions

View File

@@ -66,6 +66,13 @@ ecm_add_qml_module(LibNeoChat GENERATE_PLUGIN_SOURCE
io.github.quotient_im.libquotient
)
ecm_qt_declare_logging_category(LibNeoChat
HEADER "general_logging.h"
IDENTIFIER "GENERAL"
CATEGORY_NAME "org.kde.neochat"
DEFAULT_SEVERITY Info
)
ecm_qt_declare_logging_category(LibNeoChat
HEADER "eventhandler_logging.h"
IDENTIFIER "EventHandling"

View File

@@ -12,6 +12,8 @@
#include "neochatroom.h"
#include "general_logging.h"
using namespace Qt::StringLiterals;
AccountManager::AccountManager(bool testMode, QObject *parent)
@@ -94,7 +96,7 @@ void AccountManager::saveAccessTokenToKeyChain(NeoChatConnection *connection)
}
const auto userId = connection->userId();
qDebug() << "Save the access token to the keychain for " << userId;
qCDebug(GENERAL) << "Save the access token to the keychain for " << userId;
auto job = new QKeychain::WritePasswordJob(qAppName());
job->setAutoDelete(true);
job->setKey(userId);
@@ -109,7 +111,7 @@ void AccountManager::saveAccessTokenToKeyChain(NeoChatConnection *connection)
QKeychain::ReadPasswordJob *AccountManager::loadAccessTokenFromKeyChain(const QString &userId)
{
qDebug() << "Reading access token from the keychain for" << userId;
qCDebug(GENERAL) << "Reading access token from the keychain for" << userId;
auto job = new QKeychain::ReadPasswordJob(qAppName(), this);
job->setKey(userId);