aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmltypeloader.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2016-08-01 14:03:35 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2016-08-02 16:17:12 +0000
commitd8198f2a16c97924700cdf96997d40dfac28917e (patch)
treeb8823907c8e253c07c713675a1485220532f80c9 /src/qml/qml/qqmltypeloader.cpp
parent44e86f701247a86da37e3a94b77853b57ab1b303 (diff)
Improve debug output handling of disk caching code
Use categorized logging to make the debugging output of disk caching more selective and also not interfere with the output expected by unit tests. Change-Id: I0f42060326dfface54d4e74da5777ffb894f5937 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmltypeloader.cpp')
-rw-r--r--src/qml/qml/qqmltypeloader.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index 9f94aa41ec..5bc9c8ac25 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -62,6 +62,7 @@
#include <QtCore/qdiriterator.h>
#include <QtQml/qqmlcomponent.h>
#include <QtCore/qwaitcondition.h>
+#include <QtCore/qloggingcategory.h>
#include <QtQml/qqmlextensioninterface.h>
#include <functional>
@@ -105,6 +106,9 @@ DEFINE_BOOL_CONFIG_OPTION(dumpErrors, QML_DUMP_ERRORS);
DEFINE_BOOL_CONFIG_OPTION(diskCache, QML_DISK_CACHE);
DEFINE_BOOL_CONFIG_OPTION(forceDiskCacheRefresh, QML_FORCE_DISK_CACHE_REFRESH);
+Q_DECLARE_LOGGING_CATEGORY(DBG_DISK_CACHE)
+Q_LOGGING_CATEGORY(DBG_DISK_CACHE, "qt.qml.diskcache")
+
QT_BEGIN_NAMESPACE
namespace {
@@ -2075,7 +2079,7 @@ bool QQmlTypeData::tryLoadFromDiskCache()
{
QString error;
if (!unit->loadFromDisk(url(), v4->iselFactory.data(), &error)) {
- qDebug() << "Error loading" << url().toString() << "from disk cache:" << error;
+ qCDebug(DBG_DISK_CACHE) << "Error loading" << url().toString() << "from disk cache:" << error;
return false;
}
}
@@ -2485,7 +2489,7 @@ void QQmlTypeData::compile()
if (diskCache() || forceDiskCacheRefresh()) {
QString errorString;
if (!m_compiledData->saveToDisk(&errorString)) {
- qDebug() << "Error saving cached version of" << m_compiledData->url().toString() << "to disk:" << errorString;
+ qCDebug(DBG_DISK_CACHE) << "Error saving cached version of" << m_compiledData->url().toString() << "to disk:" << errorString;
}
}
}
@@ -2877,7 +2881,7 @@ void QQmlScriptBlob::dataReceived(const Data &data)
initializeFromCompilationUnit(unit);
return;
} else {
- qDebug() << "Error loading" << url().toString() << "from disk cache:" << error;
+ qCDebug(DBG_DISK_CACHE()) << "Error loading" << url().toString() << "from disk cache:" << error;
}
}
@@ -2919,7 +2923,7 @@ void QQmlScriptBlob::dataReceived(const Data &data)
if (diskCache() || forceDiskCacheRefresh()) {
QString errorString;
if (!unit->saveToDisk(&errorString)) {
- qDebug() << "Error saving cached version of" << unit->url().toString() << "to disk:" << errorString;
+ qCDebug(DBG_DISK_CACHE()) << "Error saving cached version of" << unit->url().toString() << "to disk:" << errorString;
}
}