From 7d76221e3990cc70ed4001c1b5f8bd8097fe20e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Sun, 12 Jan 2025 18:21:07 +0100 Subject: [PATCH] Add Deck Loader logging category. --- cockatrice/resources/config/qtlogging.ini | 3 ++- cockatrice/src/deck/deck_loader.cpp | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cockatrice/resources/config/qtlogging.ini b/cockatrice/resources/config/qtlogging.ini index 325ac6536..d51809d58 100644 --- a/cockatrice/resources/config/qtlogging.ini +++ b/cockatrice/resources/config/qtlogging.ini @@ -1,2 +1,3 @@ [Rules] -picture_loader.debug = true \ No newline at end of file +picture_loader.debug = true +deck_loader.debug = true \ No newline at end of file diff --git a/cockatrice/src/deck/deck_loader.cpp b/cockatrice/src/deck/deck_loader.cpp index c0751f8cf..861a75018 100644 --- a/cockatrice/src/deck/deck_loader.cpp +++ b/cockatrice/src/deck/deck_loader.cpp @@ -10,6 +10,9 @@ #include #include #include +#include + +Q_LOGGING_CATEGORY(DeckLoaderLog, "deck_loader") const QStringList DeckLoader::fileNameFilters = QStringList() << QObject::tr("Common deck formats (*.cod *.dec *.dek *.txt *.mwDeck)") @@ -49,9 +52,9 @@ bool DeckLoader::loadFromFile(const QString &fileName, FileFormat fmt, bool user break; case CockatriceFormat: { result = loadFromFile_Native(&file); - qDebug() << "Loaded from" << fileName << "-" << result; + qCDebug(DeckLoaderLog) << "Loaded from" << fileName << "-" << result; if (!result) { - qDebug() << "Retrying as plain format"; + qCDebug(DeckLoaderLog) << "Retrying as plain format"; file.seek(0); result = loadFromFile_Plain(&file); fmt = PlainTextFormat; @@ -73,7 +76,7 @@ bool DeckLoader::loadFromFile(const QString &fileName, FileFormat fmt, bool user emit deckLoaded(); } - qDebug() << "Deck was loaded -" << result; + qCDebug(DeckLoaderLog) << "Deck was loaded -" << result; return result; }