aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud/dropbox
diff options
context:
space:
mode:
authorAlexander Tkachev2016-07-23 12:52:27 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commit15c6772ff7638e104027f7b7777180e6191841fc (patch)
tree7887ce51ef6c3d6fd7ab574aa0e7da85d47067f8 /backends/cloud/dropbox
parentd57e0c89b5b20dac247cb2f43450014d84719ba6 (diff)
downloadscummvm-rg350-15c6772ff7638e104027f7b7777180e6191841fc.tar.gz
scummvm-rg350-15c6772ff7638e104027f7b7777180e6191841fc.tar.bz2
scummvm-rg350-15c6772ff7638e104027f7b7777180e6191841fc.zip
ALL: Fix debug, warning and error usage
Added prefixes, used debug(9).
Diffstat (limited to 'backends/cloud/dropbox')
-rw-r--r--backends/cloud/dropbox/dropboxcreatedirectoryrequest.cpp2
-rw-r--r--backends/cloud/dropbox/dropboxinforequest.cpp4
-rw-r--r--backends/cloud/dropbox/dropboxstorage.cpp14
-rw-r--r--backends/cloud/dropbox/dropboxuploadrequest.cpp11
4 files changed, 15 insertions, 16 deletions
diff --git a/backends/cloud/dropbox/dropboxcreatedirectoryrequest.cpp b/backends/cloud/dropbox/dropboxcreatedirectoryrequest.cpp
index ad9b0fcc0d..6cc6801bc0 100644
--- a/backends/cloud/dropbox/dropboxcreatedirectoryrequest.cpp
+++ b/backends/cloud/dropbox/dropboxcreatedirectoryrequest.cpp
@@ -80,7 +80,7 @@ void DropboxCreateDirectoryRequest::responseCallback(Networking::JsonResponse re
error.httpResponseCode = rq->getNetworkReadStream()->httpResponseCode();
if (!json) {
- warning("NULL passed instead of JSON");
+ warning("DropboxCreateDirectoryRequest: NULL passed instead of JSON");
finishError(error);
return;
}
diff --git a/backends/cloud/dropbox/dropboxinforequest.cpp b/backends/cloud/dropbox/dropboxinforequest.cpp
index 207c20271a..c5cbb9d917 100644
--- a/backends/cloud/dropbox/dropboxinforequest.cpp
+++ b/backends/cloud/dropbox/dropboxinforequest.cpp
@@ -77,7 +77,7 @@ void DropboxInfoRequest::userResponseCallback(Networking::JsonResponse response)
error.httpResponseCode = rq->getNetworkReadStream()->httpResponseCode();
if (!json) {
- warning("NULL passed instead of JSON");
+ warning("DropboxInfoRequest: NULL passed instead of JSON");
finishError(error);
return;
}
@@ -115,7 +115,7 @@ void DropboxInfoRequest::quotaResponseCallback(Networking::JsonResponse response
error.httpResponseCode = rq->getNetworkReadStream()->httpResponseCode();
if (!json) {
- warning("NULL passed instead of JSON");
+ warning("DropboxInfoRequest: NULL passed instead of JSON");
finishError(error);
return;
}
diff --git a/backends/cloud/dropbox/dropboxstorage.cpp b/backends/cloud/dropbox/dropboxstorage.cpp
index 20f8a68327..6fd1f9d2fd 100644
--- a/backends/cloud/dropbox/dropboxstorage.cpp
+++ b/backends/cloud/dropbox/dropboxstorage.cpp
@@ -86,8 +86,8 @@ void DropboxStorage::codeFlowComplete(Networking::JsonResponse response) {
if (json) {
Common::JSONObject result = json->asObject();
if (!result.contains("access_token") || !result.contains("uid")) {
- warning("%s", json->stringify(true).c_str());
- warning("Bad response, no token/uid passed");
+ warning("DropboxStorage: bad response, no token/uid passed");
+ debug(9, "%s", json->stringify(true).c_str());
CloudMan.removeStorage(this);
} else {
_token = result.getVal("access_token")->asString();
@@ -99,14 +99,14 @@ void DropboxStorage::codeFlowComplete(Networking::JsonResponse response) {
delete json;
} else {
- debug("DropboxStorage::codeFlowComplete: got NULL instead of JSON!");
+ debug(9, "DropboxStorage::codeFlowComplete: got NULL instead of JSON!");
CloudMan.removeStorage(this);
}
}
void DropboxStorage::codeFlowFailed(Networking::ErrorResponse error) {
- debug("Dropbox's code flow failed (%s, %ld):", (error.failed ? "failed" : "interrupted"), error.httpResponseCode);
- debug("%s", error.response.c_str());
+ debug(9, "DropboxStorage: code flow failed (%s, %ld):", (error.failed ? "failed" : "interrupted"), error.httpResponseCode);
+ debug(9, "%s", error.response.c_str());
CloudMan.removeStorage(this);
}
@@ -161,12 +161,12 @@ DropboxStorage *DropboxStorage::loadFromConfig(Common::String keyPrefix) {
loadKeyAndSecret();
if (!ConfMan.hasKey(keyPrefix + "access_token", ConfMan.kCloudDomain)) {
- warning("No access_token found");
+ warning("DropboxStorage: no access_token found");
return nullptr;
}
if (!ConfMan.hasKey(keyPrefix + "user_id", ConfMan.kCloudDomain)) {
- warning("No user_id found");
+ warning("DropboxStorage: no user_id found");
return nullptr;
}
diff --git a/backends/cloud/dropbox/dropboxuploadrequest.cpp b/backends/cloud/dropbox/dropboxuploadrequest.cpp
index f129eaa94d..dd3a381b7a 100644
--- a/backends/cloud/dropbox/dropboxuploadrequest.cpp
+++ b/backends/cloud/dropbox/dropboxuploadrequest.cpp
@@ -123,7 +123,6 @@ void DropboxUploadRequest::uploadNextPart() {
}
void DropboxUploadRequest::partUploadedCallback(Networking::JsonResponse response) {
- debug(9, "partUploadedCallback");
_workingRequest = nullptr;
if (_ignoreCallback)
return;
@@ -133,6 +132,7 @@ void DropboxUploadRequest::partUploadedCallback(Networking::JsonResponse respons
if (rq && rq->getNetworkReadStream())
error.httpResponseCode = rq->getNetworkReadStream()->httpResponseCode();
+ // TODO: add more JSON-related warnings
Common::JSONValue *json = response.value;
if (json) {
bool needsFinishRequest = false;
@@ -140,7 +140,7 @@ void DropboxUploadRequest::partUploadedCallback(Networking::JsonResponse respons
if (json->isObject()) {
Common::JSONObject object = json->asObject();
- //debug("%s", json->stringify(true).c_str());
+ //debug(9, "%s", json->stringify(true).c_str());
if (object.contains("error") || object.contains("error_summary")) {
warning("Dropbox returned error: %s", object.getVal("error_summary")->asString().c_str());
@@ -163,19 +163,19 @@ void DropboxUploadRequest::partUploadedCallback(Networking::JsonResponse respons
if (object.contains("session_id"))
_sessionId = object.getVal("session_id")->asString();
else
- warning("no session_id found in Dropbox's response");
+ warning("DropboxUploadRequest: no session_id found");
needsFinishRequest = true;
}
}
if (!needsFinishRequest && (_contentsStream->eos() || _contentsStream->pos() >= _contentsStream->size() - 1)) {
- warning("no file info to return");
+ warning("DropboxUploadRequest: no file info to return");
finishUpload(StorageFile(_savePath, 0, 0, false));
} else {
uploadNextPart();
}
} else {
- warning("null, not json");
+ warning("DropboxUploadRequest: null, not json");
finishError(error);
}
@@ -183,7 +183,6 @@ void DropboxUploadRequest::partUploadedCallback(Networking::JsonResponse respons
}
void DropboxUploadRequest::partUploadedErrorCallback(Networking::ErrorResponse error) {
- debug("partUploadedErrorCallback");
_workingRequest = nullptr;
if (_ignoreCallback)
return;