Clean up some unnecessary classes in logging statements.

This commit is contained in:
Lukas Brübach 2025-01-19 03:55:59 +01:00
parent 40d34e0f21
commit 839e241370
5 changed files with 34 additions and 34 deletions

View file

@ -89,7 +89,7 @@ void PictureLoader::getPixmap(QPixmap &pixmap, CardInfoPtr card, QSize size)
} }
// add the card to the load queue // add the card to the load queue
qCDebug(PictureLoaderLog) << "PictureLoader: Enqueuing " << card->getName() << " for " << card->getPixmapCacheKey(); qCDebug(PictureLoaderLog) << "Enqueuing " << card->getName() << " for " << card->getPixmapCacheKey();
getInstance().worker->enqueueImageLoad(card); getInstance().worker->enqueueImageLoad(card);
} }

View file

@ -81,7 +81,7 @@ void PictureLoaderWorker::processLoadQueue()
QString correctedCardName = cardBeingLoaded.getCard()->getCorrectedName(); QString correctedCardName = cardBeingLoaded.getCard()->getCorrectedName();
qCDebug(PictureLoaderWorkerLog).nospace() qCDebug(PictureLoaderWorkerLog).nospace()
<< "PictureLoader: [card: " << cardName << " set: " << setName << "]: Trying to load picture"; << "[card: " << cardName << " set: " << setName << "]: Trying to load picture";
if (CardDatabaseManager::getInstance()->isProviderIdForPreferredPrinting( if (CardDatabaseManager::getInstance()->isProviderIdForPreferredPrinting(
cardName, cardBeingLoaded.getCard()->getPixmapCacheKey())) { cardName, cardBeingLoaded.getCard()->getPixmapCacheKey())) {
@ -90,7 +90,7 @@ void PictureLoaderWorker::processLoadQueue()
} }
} }
qCDebug(PictureLoaderWorkerLog).nospace() << "PictureLoader: [card: " << cardName << " set: " << setName qCDebug(PictureLoaderWorkerLog).nospace() << "[card: " << cardName << " set: " << setName
<< "]: No custom picture, trying to download"; << "]: No custom picture, trying to download";
cardsToDownload.append(cardBeingLoaded); cardsToDownload.append(cardBeingLoaded);
cardBeingLoaded.clear(); cardBeingLoaded.clear();
@ -134,20 +134,20 @@ bool PictureLoaderWorker::cardImageExistsOnDisk(QString &setName, QString &corre
imgReader.setFileName(_picsPath); imgReader.setFileName(_picsPath);
if (imgReader.read(&image)) { if (imgReader.read(&image)) {
qCDebug(PictureLoaderWorkerLog).nospace() qCDebug(PictureLoaderWorkerLog).nospace()
<< "PictureLoader: [card: " << correctedCardname << " set: " << setName << "]: Picture found on disk."; << "[card: " << correctedCardname << " set: " << setName << "]: Picture found on disk.";
imageLoaded(cardBeingLoaded.getCard(), image); imageLoaded(cardBeingLoaded.getCard(), image);
return true; return true;
} }
imgReader.setFileName(_picsPath + ".full"); imgReader.setFileName(_picsPath + ".full");
if (imgReader.read(&image)) { if (imgReader.read(&image)) {
qCDebug(PictureLoaderWorkerLog).nospace() << "PictureLoader: [card: " << correctedCardname qCDebug(PictureLoaderWorkerLog).nospace() << "[card: " << correctedCardname
<< " set: " << setName << "]: Picture.full found on disk."; << " set: " << setName << "]: Picture.full found on disk.";
imageLoaded(cardBeingLoaded.getCard(), image); imageLoaded(cardBeingLoaded.getCard(), image);
return true; return true;
} }
imgReader.setFileName(_picsPath + ".xlhq"); imgReader.setFileName(_picsPath + ".xlhq");
if (imgReader.read(&image)) { if (imgReader.read(&image)) {
qCDebug(PictureLoaderWorkerLog).nospace() << "PictureLoader: [card: " << correctedCardname qCDebug(PictureLoaderWorkerLog).nospace() << "[card: " << correctedCardname
<< " set: " << setName << "]: Picture.xlhq found on disk."; << " set: " << setName << "]: Picture.xlhq found on disk.";
imageLoaded(cardBeingLoaded.getCard(), image); imageLoaded(cardBeingLoaded.getCard(), image);
return true; return true;
@ -177,7 +177,7 @@ void PictureLoaderWorker::startNextPicDownload()
} else { } else {
QUrl url(picUrl); QUrl url(picUrl);
qCDebug(PictureLoaderWorkerLog).nospace() qCDebug(PictureLoaderWorkerLog).nospace()
<< "PictureLoader: [card: " << cardBeingDownloaded.getCard()->getCorrectedName() << "[card: " << cardBeingDownloaded.getCard()->getCorrectedName()
<< " set: " << cardBeingDownloaded.getSetName() << "]: Trying to fetch picture from url " << " set: " << cardBeingDownloaded.getSetName() << "]: Trying to fetch picture from url "
<< url.toDisplayString(); << url.toDisplayString();
makeRequest(url); makeRequest(url);
@ -196,7 +196,7 @@ void PictureLoaderWorker::picDownloadFailed()
mutex.unlock(); mutex.unlock();
} else { } else {
qCDebug(PictureLoaderWorkerLog).nospace() qCDebug(PictureLoaderWorkerLog).nospace()
<< "PictureLoader: [card: " << cardBeingDownloaded.getCard()->getCorrectedName() << "[card: " << cardBeingDownloaded.getCard()->getCorrectedName()
<< " set: " << cardBeingDownloaded.getSetName() << "]: Picture NOT found, " << " set: " << cardBeingDownloaded.getSetName() << "]: Picture NOT found, "
<< (picDownload ? "download failed" : "downloads disabled") << (picDownload ? "download failed" : "downloads disabled")
<< ", no more url combinations to try: BAILING OUT"; << ", no more url combinations to try: BAILING OUT";
@ -218,7 +218,7 @@ QNetworkReply *PictureLoaderWorker::makeRequest(const QUrl &url)
QUrl cachedRedirect = getCachedRedirect(url); QUrl cachedRedirect = getCachedRedirect(url);
if (!cachedRedirect.isEmpty()) { if (!cachedRedirect.isEmpty()) {
qCDebug(PictureLoaderWorkerLog).nospace() qCDebug(PictureLoaderWorkerLog).nospace()
<< "PictureLoader: [card: " << cardBeingDownloaded.getCard()->getCorrectedName() << "[card: " << cardBeingDownloaded.getCard()->getCorrectedName()
<< " set: " << cardBeingDownloaded.getSetName() << "]: Using cached redirect for " << url.toDisplayString() << " set: " << cardBeingDownloaded.getSetName() << "]: Using cached redirect for " << url.toDisplayString()
<< " to " << cachedRedirect.toDisplayString(); << " to " << cachedRedirect.toDisplayString();
return makeRequest(cachedRedirect); // Use the cached redirect return makeRequest(cachedRedirect); // Use the cached redirect
@ -243,7 +243,7 @@ QNetworkReply *PictureLoaderWorker::makeRequest(const QUrl &url)
cacheRedirect(url, redirectUrl); cacheRedirect(url, redirectUrl);
qCDebug(PictureLoaderWorkerLog).nospace() qCDebug(PictureLoaderWorkerLog).nospace()
<< "PictureLoader: [card: " << cardBeingDownloaded.getCard()->getCorrectedName() << "[card: " << cardBeingDownloaded.getCard()->getCorrectedName()
<< " set: " << cardBeingDownloaded.getSetName() << "]: Caching redirect from " << url.toDisplayString() << " set: " << cardBeingDownloaded.getSetName() << "]: Caching redirect from " << url.toDisplayString()
<< " to " << redirectUrl.toDisplayString(); << " to " << redirectUrl.toDisplayString();
} }
@ -323,7 +323,7 @@ void PictureLoaderWorker::picDownloadFinished(QNetworkReply *reply)
if (reply->error()) { if (reply->error()) {
if (isFromCache) { if (isFromCache) {
qCDebug(PictureLoaderWorkerLog).nospace() qCDebug(PictureLoaderWorkerLog).nospace()
<< "PictureLoader: [card: " << cardBeingDownloaded.getCard()->getName() << "[card: " << cardBeingDownloaded.getCard()->getName()
<< " set: " << cardBeingDownloaded.getSetName() << "]: Removing corrupted cache file for url " << " set: " << cardBeingDownloaded.getSetName() << "]: Removing corrupted cache file for url "
<< reply->url().toDisplayString() << " and retrying (" << reply->errorString() << ")"; << reply->url().toDisplayString() << " and retrying (" << reply->errorString() << ")";
@ -332,7 +332,7 @@ void PictureLoaderWorker::picDownloadFinished(QNetworkReply *reply)
makeRequest(reply->url()); makeRequest(reply->url());
} else { } else {
qCDebug(PictureLoaderWorkerLog).nospace() qCDebug(PictureLoaderWorkerLog).nospace()
<< "PictureLoader: [card: " << cardBeingDownloaded.getCard()->getName() << "[card: " << cardBeingDownloaded.getCard()->getName()
<< " set: " << cardBeingDownloaded.getSetName() << "]: " << (picDownload ? "Download" : "Cache search") << " set: " << cardBeingDownloaded.getSetName() << "]: " << (picDownload ? "Download" : "Cache search")
<< " failed for url " << reply->url().toDisplayString() << " (" << reply->errorString() << ")"; << " failed for url " << reply->url().toDisplayString() << " (" << reply->errorString() << ")";
@ -350,7 +350,7 @@ void PictureLoaderWorker::picDownloadFinished(QNetworkReply *reply)
statusCode == 308) { statusCode == 308) {
QUrl redirectUrl = reply->header(QNetworkRequest::LocationHeader).toUrl(); QUrl redirectUrl = reply->header(QNetworkRequest::LocationHeader).toUrl();
qCDebug(PictureLoaderWorkerLog).nospace() qCDebug(PictureLoaderWorkerLog).nospace()
<< "PictureLoader: [card: " << cardBeingDownloaded.getCard()->getName() << "[card: " << cardBeingDownloaded.getCard()->getName()
<< " set: " << cardBeingDownloaded.getSetName() << "]: following " << " set: " << cardBeingDownloaded.getSetName() << "]: following "
<< (isFromCache ? "cached redirect" : "redirect") << " to " << redirectUrl.toDisplayString(); << (isFromCache ? "cached redirect" : "redirect") << " to " << redirectUrl.toDisplayString();
makeRequest(redirectUrl); makeRequest(redirectUrl);
@ -363,7 +363,7 @@ void PictureLoaderWorker::picDownloadFinished(QNetworkReply *reply)
if (imageIsBlackListed(picData)) { if (imageIsBlackListed(picData)) {
qCDebug(PictureLoaderWorkerLog).nospace() qCDebug(PictureLoaderWorkerLog).nospace()
<< "PictureLoader: [card: " << cardBeingDownloaded.getCard()->getName() << "[card: " << cardBeingDownloaded.getCard()->getName()
<< " set: " << cardBeingDownloaded.getSetName() << " set: " << cardBeingDownloaded.getSetName()
<< "]: Picture found, but blacklisted, will consider it as not found"; << "]: Picture found, but blacklisted, will consider it as not found";
@ -399,7 +399,7 @@ void PictureLoaderWorker::picDownloadFinished(QNetworkReply *reply)
logSuccessMessage = true; logSuccessMessage = true;
} else { } else {
qCDebug(PictureLoaderWorkerLog).nospace() qCDebug(PictureLoaderWorkerLog).nospace()
<< "PictureLoader: [card: " << cardBeingDownloaded.getCard()->getName() << "[card: " << cardBeingDownloaded.getCard()->getName()
<< " set: " << cardBeingDownloaded.getSetName() << "]: Possible " << (isFromCache ? "cached" : "downloaded") << " set: " << cardBeingDownloaded.getSetName() << "]: Possible " << (isFromCache ? "cached" : "downloaded")
<< " picture at " << reply->url().toDisplayString() << " could not be loaded: " << reply->errorString(); << " picture at " << reply->url().toDisplayString() << " could not be loaded: " << reply->errorString();
@ -408,7 +408,7 @@ void PictureLoaderWorker::picDownloadFinished(QNetworkReply *reply)
if (logSuccessMessage) { if (logSuccessMessage) {
qCDebug(PictureLoaderWorkerLog).nospace() qCDebug(PictureLoaderWorkerLog).nospace()
<< "PictureLoader: [card: " << cardBeingDownloaded.getCard()->getName() << "[card: " << cardBeingDownloaded.getCard()->getName()
<< " set: " << cardBeingDownloaded.getSetName() << "]: Image successfully " << " set: " << cardBeingDownloaded.getSetName() << "]: Image successfully "
<< (isFromCache ? "loaded from cached" : "downloaded from") << " url " << reply->url().toDisplayString(); << (isFromCache ? "loaded from cached" : "downloaded from") << " url " << reply->url().toDisplayString();
} }

View file

@ -582,7 +582,7 @@ LoadStatus CardDatabase::loadCardDatabase(const QString &path)
} }
int msecs = startTime.msecsTo(QTime::currentTime()); int msecs = startTime.msecsTo(QTime::currentTime());
qCDebug(CardDatabaseLoadingLog) << "[CardDatabase] loadCardDatabase(): Path =" << path qCDebug(CardDatabaseLoadingLog) << "Path =" << path
<< "Status =" << tempLoadStatus << "Cards =" << cards.size() << "Status =" << tempLoadStatus << "Cards =" << cards.size()
<< "Sets =" << sets.size() << QString("%1ms").arg(msecs); << "Sets =" << sets.size() << QString("%1ms").arg(msecs);
@ -593,7 +593,7 @@ LoadStatus CardDatabase::loadCardDatabases()
{ {
reloadDatabaseMutex->lock(); reloadDatabaseMutex->lock();
qCDebug(CardDatabaseLoadingLog) << "CardDatabase::loadCardDatabases start"; qCDebug(CardDatabaseLoadingLog) << "Started";
clear(); // remove old db clear(); // remove old db
@ -627,10 +627,10 @@ LoadStatus CardDatabase::loadCardDatabases()
if (loadStatus == Ok) { if (loadStatus == Ok) {
checkUnknownSets(); // update deck editors, etc checkUnknownSets(); // update deck editors, etc
qCDebug(CardDatabaseLoadingSuccessOrFailureLog) << "CardDatabase::loadCardDatabases success"; qCDebug(CardDatabaseLoadingSuccessOrFailureLog) << "Success";
emit cardDatabaseLoadingFinished(); emit cardDatabaseLoadingFinished();
} else { } else {
qCDebug(CardDatabaseLoadingSuccessOrFailureLog) << "CardDatabase::loadCardDatabases failed"; qCDebug(CardDatabaseLoadingSuccessOrFailureLog) << "Failed";
emit cardDatabaseLoadingFailed(); // bring up the settings dialog emit cardDatabaseLoadingFailed(); // bring up the settings dialog
} }

View file

@ -13,10 +13,10 @@
bool CockatriceXml3Parser::getCanParseFile(const QString &fileName, QIODevice &device) bool CockatriceXml3Parser::getCanParseFile(const QString &fileName, QIODevice &device)
{ {
qCDebug(CockatriceXml3Log) << "[CockatriceXml3Parser] Trying to parse: " << fileName; qCDebug(CockatriceXml3Log) << "Trying to parse: " << fileName;
if (!fileName.endsWith(".xml", Qt::CaseInsensitive)) { if (!fileName.endsWith(".xml", Qt::CaseInsensitive)) {
qCDebug(CockatriceXml3Log) << "[CockatriceXml3Parser] Parsing failed: wrong extension"; qCDebug(CockatriceXml3Log) << "Parsing failed: wrong extension";
return false; return false;
} }
@ -28,12 +28,12 @@ bool CockatriceXml3Parser::getCanParseFile(const QString &fileName, QIODevice &d
if (version == COCKATRICE_XML3_TAGVER) { if (version == COCKATRICE_XML3_TAGVER) {
return true; return true;
} else { } else {
qCDebug(CockatriceXml3Log) << "[CockatriceXml3Parser] Parsing failed: wrong version" << version; qCDebug(CockatriceXml3Log) << "Parsing failed: wrong version" << version;
return false; return false;
} }
} else { } else {
qCDebug(CockatriceXml3Log) << "[CockatriceXml3Parser] Parsing failed: wrong element tag" << xml.name(); qCDebug(CockatriceXml3Log) << "Parsing failed: wrong element tag" << xml.name();
return false; return false;
} }
} }
@ -59,7 +59,7 @@ void CockatriceXml3Parser::parseFile(QIODevice &device)
loadCardsFromXml(xml); loadCardsFromXml(xml);
} else if (!name.isEmpty()) { } else if (!name.isEmpty()) {
qCDebug(CockatriceXml3Log) qCDebug(CockatriceXml3Log)
<< "[CockatriceXml3Parser] Unknown item" << name << ", trying to continue anyway"; << "Unknown item" << name << ", trying to continue anyway";
xml.skipCurrentElement(); xml.skipCurrentElement();
} }
} }
@ -95,7 +95,7 @@ void CockatriceXml3Parser::loadSetsFromXml(QXmlStreamReader &xml)
QDate::fromString(xml.readElementText(QXmlStreamReader::IncludeChildElements), Qt::ISODate); QDate::fromString(xml.readElementText(QXmlStreamReader::IncludeChildElements), Qt::ISODate);
} else if (!name.isEmpty()) { } else if (!name.isEmpty()) {
qCDebug(CockatriceXml3Log) qCDebug(CockatriceXml3Log)
<< "[CockatriceXml3Parser] Unknown set property" << name << ", trying to continue anyway"; << "Unknown set property" << name << ", trying to continue anyway";
xml.skipCurrentElement(); xml.skipCurrentElement();
} }
} }
@ -266,7 +266,7 @@ void CockatriceXml3Parser::loadCardsFromXml(QXmlStreamReader &xml)
} }
} else if (!xmlName.isEmpty()) { } else if (!xmlName.isEmpty()) {
qCDebug(CockatriceXml3Log) qCDebug(CockatriceXml3Log)
<< "[CockatriceXml3Parser] Unknown card property" << xmlName << ", trying to continue anyway"; << "Unknown card property" << xmlName << ", trying to continue anyway";
xml.skipCurrentElement(); xml.skipCurrentElement();
} }
} }

View file

@ -13,10 +13,10 @@
bool CockatriceXml4Parser::getCanParseFile(const QString &fileName, QIODevice &device) bool CockatriceXml4Parser::getCanParseFile(const QString &fileName, QIODevice &device)
{ {
qCDebug(CockatriceXml4Log) << "[CockatriceXml4Parser] Trying to parse: " << fileName; qCDebug(CockatriceXml4Log) << "Trying to parse: " << fileName;
if (!fileName.endsWith(".xml", Qt::CaseInsensitive)) { if (!fileName.endsWith(".xml", Qt::CaseInsensitive)) {
qCDebug(CockatriceXml4Log) << "[CockatriceXml4Parser] Parsing failed: wrong extension"; qCDebug(CockatriceXml4Log) << "Parsing failed: wrong extension";
return false; return false;
} }
@ -28,12 +28,12 @@ bool CockatriceXml4Parser::getCanParseFile(const QString &fileName, QIODevice &d
if (version == COCKATRICE_XML4_TAGVER) { if (version == COCKATRICE_XML4_TAGVER) {
return true; return true;
} else { } else {
qCDebug(CockatriceXml4Log) << "[CockatriceXml4Parser] Parsing failed: wrong version" << version; qCDebug(CockatriceXml4Log) << "Parsing failed: wrong version" << version;
return false; return false;
} }
} else { } else {
qCDebug(CockatriceXml4Log) << "[CockatriceXml4Parser] Parsing failed: wrong element tag" << xml.name(); qCDebug(CockatriceXml4Log) << "Parsing failed: wrong element tag" << xml.name();
return false; return false;
} }
} }
@ -59,7 +59,7 @@ void CockatriceXml4Parser::parseFile(QIODevice &device)
loadCardsFromXml(xml); loadCardsFromXml(xml);
} else if (!xmlName.isEmpty()) { } else if (!xmlName.isEmpty()) {
qCDebug(CockatriceXml4Log) qCDebug(CockatriceXml4Log)
<< "[CockatriceXml4Parser] Unknown item" << xmlName << ", trying to continue anyway"; << "Unknown item" << xmlName << ", trying to continue anyway";
xml.skipCurrentElement(); xml.skipCurrentElement();
} }
} }
@ -98,7 +98,7 @@ void CockatriceXml4Parser::loadSetsFromXml(QXmlStreamReader &xml)
priority = xml.readElementText(QXmlStreamReader::IncludeChildElements).toShort(); priority = xml.readElementText(QXmlStreamReader::IncludeChildElements).toShort();
} else if (!xmlName.isEmpty()) { } else if (!xmlName.isEmpty()) {
qCDebug(CockatriceXml4Log) qCDebug(CockatriceXml4Log)
<< "[CockatriceXml4Parser] Unknown set property" << xmlName << ", trying to continue anyway"; << "Unknown set property" << xmlName << ", trying to continue anyway";
xml.skipCurrentElement(); xml.skipCurrentElement();
} }
} }
@ -232,7 +232,7 @@ void CockatriceXml4Parser::loadCardsFromXml(QXmlStreamReader &xml)
} }
} else if (!xmlName.isEmpty()) { } else if (!xmlName.isEmpty()) {
qCDebug(CockatriceXml4Log) qCDebug(CockatriceXml4Log)
<< "[CockatriceXml4Parser] Unknown card property" << xmlName << ", trying to continue anyway"; << "Unknown card property" << xmlName << ", trying to continue anyway";
xml.skipCurrentElement(); xml.skipCurrentElement();
} }
} }