aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud/onedrive
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/onedrive
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/onedrive')
-rw-r--r--backends/cloud/onedrive/onedrivecreatedirectoryrequest.cpp2
-rw-r--r--backends/cloud/onedrive/onedrivestorage.cpp22
-rw-r--r--backends/cloud/onedrive/onedrivetokenrefresher.cpp6
-rw-r--r--backends/cloud/onedrive/onedriveuploadrequest.cpp8
4 files changed, 19 insertions, 19 deletions
diff --git a/backends/cloud/onedrive/onedrivecreatedirectoryrequest.cpp b/backends/cloud/onedrive/onedrivecreatedirectoryrequest.cpp
index a31fd025ac..4d6d8fceda 100644
--- a/backends/cloud/onedrive/onedrivecreatedirectoryrequest.cpp
+++ b/backends/cloud/onedrive/onedrivecreatedirectoryrequest.cpp
@@ -102,7 +102,7 @@ void OneDriveCreateDirectoryRequest::responseCallback(Networking::JsonResponse r
error.httpResponseCode = rq->getNetworkReadStream()->httpResponseCode();
if (!json) {
- warning("NULL passed instead of JSON");
+ warning("OneDriveCreateDirectoryRequest: NULL passed instead of JSON");
finishError(error);
return;
}
diff --git a/backends/cloud/onedrive/onedrivestorage.cpp b/backends/cloud/onedrive/onedrivestorage.cpp
index af5d9f10ba..1008cab31f 100644
--- a/backends/cloud/onedrive/onedrivestorage.cpp
+++ b/backends/cloud/onedrive/onedrivestorage.cpp
@@ -113,8 +113,8 @@ void OneDriveStorage::tokenRefreshed(BoolCallback callback, Networking::JsonResp
Common::JSONObject result = json->asObject();
if (!result.contains("access_token") || !result.contains("user_id") || !result.contains("refresh_token")) {
- warning("Bad response, no token or user_id passed");
- debug("%s", json->stringify().c_str());
+ warning("OneDriveStorage: bad response, no token or user_id passed");
+ debug(9, "%s", json->stringify().c_str());
if (callback)
(*callback)(BoolResponse(nullptr, false));
} else {
@@ -141,8 +141,8 @@ void OneDriveStorage::codeFlowComplete(BoolResponse response) {
}
void OneDriveStorage::codeFlowFailed(Networking::ErrorResponse error) {
- debug("OneDrive's code flow failed (%s, %ld):", (error.failed ? "failed" : "interrupted"), error.httpResponseCode);
- debug("%s", error.response.c_str());
+ debug(9, "OneDriveStorage: code flow failed (%s, %ld):", (error.failed ? "failed" : "interrupted"), error.httpResponseCode);
+ debug(9, "%s", error.response.c_str());
CloudMan.removeStorage(this);
}
@@ -159,7 +159,7 @@ Common::String OneDriveStorage::name() const {
void OneDriveStorage::infoInnerCallback(StorageInfoCallback outerCallback, Networking::JsonResponse response) {
Common::JSONValue *json = response.value;
if (!json) {
- warning("NULL passed instead of JSON");
+ warning("OneDriveStorage: NULL passed instead of JSON");
delete outerCallback;
return;
}
@@ -199,7 +199,7 @@ void OneDriveStorage::infoInnerCallback(StorageInfoCallback outerCallback, Netwo
void OneDriveStorage::fileInfoCallback(Networking::NetworkReadStreamCallback outerCallback, Networking::JsonResponse response) {
if (!response.value) {
- warning("fileInfoCallback: NULL");
+ warning("OneDriveStorage::fileInfoCallback: NULL, not JSON");
if (outerCallback)
(*outerCallback)(Networking::NetworkReadStreamResponse(response.request, nullptr));
return;
@@ -214,8 +214,8 @@ void OneDriveStorage::fileInfoCallback(Networking::NetworkReadStreamCallback out
new Networking::NetworkReadStream(url, nullptr, "")
));
} else {
- warning("downloadUrl not found in passed JSON");
- debug("%s", response.value->stringify().c_str());
+ warning("OneDriveStorage: downloadUrl not found in passed JSON");
+ debug(9, "%s", response.value->stringify().c_str());
if (outerCallback)
(*outerCallback)(Networking::NetworkReadStreamResponse(response.request, nullptr));
}
@@ -257,17 +257,17 @@ OneDriveStorage *OneDriveStorage::loadFromConfig(Common::String keyPrefix) {
loadKeyAndSecret();
if (!ConfMan.hasKey(keyPrefix + "access_token", ConfMan.kCloudDomain)) {
- warning("No access_token found");
+ warning("OneDriveStorage: no access_token found");
return nullptr;
}
if (!ConfMan.hasKey(keyPrefix + "user_id", ConfMan.kCloudDomain)) {
- warning("No user_id found");
+ warning("OneDriveStorage: no user_id found");
return nullptr;
}
if (!ConfMan.hasKey(keyPrefix + "refresh_token", ConfMan.kCloudDomain)) {
- warning("No refresh_token found");
+ warning("OneDriveStorage: no refresh_token found");
return nullptr;
}
diff --git a/backends/cloud/onedrive/onedrivetokenrefresher.cpp b/backends/cloud/onedrive/onedrivetokenrefresher.cpp
index f7597599c7..5e3bce96af 100644
--- a/backends/cloud/onedrive/onedrivetokenrefresher.cpp
+++ b/backends/cloud/onedrive/onedrivetokenrefresher.cpp
@@ -69,7 +69,7 @@ void OneDriveTokenRefresher::finishJson(Common::JSONValue *json) {
//new token needed => request token & then retry original request
if (_stream) {
httpResponseCode = _stream->httpResponseCode();
- debug(9, "code %ld", httpResponseCode);
+ debug(9, "OneDriveTokenRefresher: code = %ld", httpResponseCode);
}
Common::JSONObject error = result.getVal("error")->asObject();
@@ -78,12 +78,12 @@ void OneDriveTokenRefresher::finishJson(Common::JSONValue *json) {
Common::String code, message;
if (error.contains("code")) {
code = error.getVal("code")->asString();
- debug(9, "code = %s", code.c_str());
+ debug(9, "OneDriveTokenRefresher: code = %s", code.c_str());
}
if (error.contains("message")) {
message = error.getVal("message")->asString();
- debug(9, "message = %s", message.c_str());
+ debug(9, "OneDriveTokenRefresher: message = %s", message.c_str());
}
//determine whether token refreshing would help in this situation
diff --git a/backends/cloud/onedrive/onedriveuploadrequest.cpp b/backends/cloud/onedrive/onedriveuploadrequest.cpp
index ef1507d1f2..172266ce2a 100644
--- a/backends/cloud/onedrive/onedriveuploadrequest.cpp
+++ b/backends/cloud/onedrive/onedriveuploadrequest.cpp
@@ -130,7 +130,7 @@ void OneDriveUploadRequest::partUploadedCallback(Networking::JsonResponse respon
Common::JSONObject object = json->asObject();
if (object.contains("error")) {
- warning("OneDrive returned error: %s", json->stringify(true).c_str());
+ warning("OneDriveUploadRequest: error: %s", json->stringify(true).c_str());
error.response = json->stringify(true);
finishError(error);
delete json;
@@ -150,18 +150,18 @@ void OneDriveUploadRequest::partUploadedCallback(Networking::JsonResponse respon
if (object.contains("uploadUrl"))
_uploadUrl = object.getVal("uploadUrl")->asString();
else
- warning("no uploadUrl found in OneDrive's response");
+ warning("OneDriveUploadRequest: no uploadUrl found");
}
}
if (_contentsStream->eos() || _contentsStream->pos() >= _contentsStream->size() - 1) {
- warning("no file info to return");
+ warning("OneDriveUploadRequest: no file info to return");
finishUpload(StorageFile(_savePath, 0, 0, false));
} else {
uploadNextPart();
}
} else {
- warning("null, not json");
+ warning("OneDriveUploadRequest: null, not json");
finishError(error);
}