History

put audio and script-engine logging into their own QLoggingCategory

Seth Alves committed 11 years ago

Commit 7af32bd1 parent cb7ff8620 files · +126 −60Browse files

Showing the changes to libraries/script-engine/src/ScriptCache.cpp (1 of 20 files). Show all

Unified · Split

libraries/script-engine/src/ScriptCache.cpp+6−6
@@ -17,7 +17,7 @@ · 16 unmodified lines
1717
1818 #include <NetworkAccessManager.h>
1919 #include <SharedUtil.h>
20−
20+#include "ScriptEngineLogging.h"
2121 #include "ScriptCache.h"
2222
2323 ScriptCache::ScriptCache(QObject* parent) {
@@ -27,7 +27,7 @@ ScriptCache::ScriptCache(QObject* parent) { · 3 unmodified lines
2727 QString ScriptCache::getScript(const QUrl& url, ScriptUser* scriptUser, bool& isPending) {
2828 QString scriptContents;
2929 if (_scriptCache.contains(url)) {
30− qDebug() << "Found script in cache:" << url.toString();
30+ qCDebug(scriptengine) << "Found script in cache:" << url.toString();
3131 scriptContents = _scriptCache[url];
3232 scriptUser->scriptContentsAvailable(url, scriptContents);
3333 isPending = false;
@@ -37,13 +37,13 @@ QString ScriptCache::getScript(const QUrl& url, ScriptUser* scriptUser, bool& is · 3 unmodified lines
3737 _scriptUsers.insert(url, scriptUser);
3838
3939 if (alreadyWaiting) {
40− qDebug() << "Already downloading script at:" << url.toString();
40+ qCDebug(scriptengine) << "Already downloading script at:" << url.toString();
4141 } else {
4242 QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance();
4343 QNetworkRequest networkRequest = QNetworkRequest(url);
4444 networkRequest.setHeader(QNetworkRequest::UserAgentHeader, HIGH_FIDELITY_USER_AGENT);
4545
46− qDebug() << "Downloading script at:" << url.toString();
46+ qCDebug(scriptengine) << "Downloading script at:" << url.toString();
4747 QNetworkReply* reply = networkAccessManager.get(networkRequest);
4848 connect(reply, &QNetworkReply::finished, this, &ScriptCache::scriptDownloaded);
4949 }
@@ -59,13 +59,13 @@ void ScriptCache::scriptDownloaded() { · 9 unmodified lines
5959
6060 if (reply->error() == QNetworkReply::NoError && reply->attribute(QNetworkRequest::HttpStatusCodeAttribute) == 200) {
6161 _scriptCache[url] = reply->readAll();
62− qDebug() << "Done downloading script at:" << url.toString();
62+ qCDebug(scriptengine) << "Done downloading script at:" << url.toString();
6363
6464 foreach(ScriptUser* user, scriptUsers) {
6565 user->scriptContentsAvailable(url, _scriptCache[url]);
6666 }
6767 } else {
68− qDebug() << "ERROR Loading file:" << reply->url().toString();
68+ qCDebug(scriptengine) << "ERROR Loading file:" << reply->url().toString();
6969 foreach(ScriptUser* user, scriptUsers) {
7070 user->errorInLoadingScript(url);
7171 }