aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud/googledrive
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/googledrive
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/googledrive')
-rw-r--r--backends/cloud/googledrive/googledrivestorage.cpp20
-rw-r--r--backends/cloud/googledrive/googledrivetokenrefresher.cpp6
-rw-r--r--backends/cloud/googledrive/googledriveuploadrequest.cpp4
3 files changed, 15 insertions, 15 deletions
diff --git a/backends/cloud/googledrive/googledrivestorage.cpp b/backends/cloud/googledrive/googledrivestorage.cpp
index af19019a1e..7ae9dde3bd 100644
--- a/backends/cloud/googledrive/googledrivestorage.cpp
+++ b/backends/cloud/googledrive/googledrivestorage.cpp
@@ -113,14 +113,14 @@ void GoogleDriveStorage::tokenRefreshed(BoolCallback callback, Networking::JsonR
Common::JSONObject result = json->asObject();
if (!result.contains("access_token")) {
- warning("Bad response, no token passed");
- debug("%s", json->stringify().c_str());
+ warning("GoogleDriveStorage: bad response, no token passed");
+ debug(9, "%s", json->stringify().c_str());
if (callback)
(*callback)(BoolResponse(nullptr, false));
} else {
_token = result.getVal("access_token")->asString();
if (!result.contains("refresh_token"))
- warning("No refresh_token passed");
+ warning("GoogleDriveStorage: no refresh_token passed");
else
_refreshToken = result.getVal("refresh_token")->asString();
CloudMan.save(); //ask CloudManager to save our new refreshToken
@@ -143,8 +143,8 @@ void GoogleDriveStorage::codeFlowComplete(BoolResponse response) {
}
void GoogleDriveStorage::codeFlowFailed(Networking::ErrorResponse error) {
- debug("Google Drive's code flow failed (%s, %ld):", (error.failed ? "failed" : "interrupted"), error.httpResponseCode);
- debug("%s", error.response.c_str());
+ debug(9, "GoogleDriveStorage: code flow failed (%s, %ld):", (error.failed ? "failed" : "interrupted"), error.httpResponseCode);
+ debug(9, "%s", error.response.c_str());
CloudMan.removeStorage(this);
}
@@ -160,7 +160,7 @@ Common::String GoogleDriveStorage::name() const {
void GoogleDriveStorage::infoInnerCallback(StorageInfoCallback outerCallback, Networking::JsonResponse response) {
Common::JSONValue *json = response.value;
if (!json) {
- warning("NULL passed instead of JSON");
+ warning("GoogleDriveStorage: NULL passed instead of JSON");
delete outerCallback;
return;
}
@@ -201,7 +201,7 @@ void GoogleDriveStorage::infoInnerCallback(StorageInfoCallback outerCallback, Ne
void GoogleDriveStorage::createDirectoryInnerCallback(BoolCallback outerCallback, Networking::JsonResponse response) {
Common::JSONValue *json = response.value;
if (!json) {
- warning("NULL passed instead of JSON");
+ warning("GoogleDriveStorage: NULL passed instead of JSON");
delete outerCallback;
return;
}
@@ -241,7 +241,7 @@ Networking::Request *GoogleDriveStorage::streamFileById(Common::String id, Netwo
}
void GoogleDriveStorage::printInfo(StorageInfoResponse response) {
- debug(9, "\nuser info:");
+ debug(9, "\nGoogleDriveStorage: user info:");
debug(9, "\tname: %s", response.value.name().c_str());
debug(9, "\temail: %s", response.value.email().c_str());
debug(9, "\tdisk usage: %lu/%lu", response.value.used(), response.value.available());
@@ -286,12 +286,12 @@ GoogleDriveStorage *GoogleDriveStorage::loadFromConfig(Common::String keyPrefix)
loadKeyAndSecret();
if (!ConfMan.hasKey(keyPrefix + "access_token", ConfMan.kCloudDomain)) {
- warning("No access_token found");
+ warning("GoogleDriveStorage: no access_token found");
return nullptr;
}
if (!ConfMan.hasKey(keyPrefix + "refresh_token", ConfMan.kCloudDomain)) {
- warning("No refresh_token found");
+ warning("GoogleDriveStorage: no refresh_token found");
return nullptr;
}
diff --git a/backends/cloud/googledrive/googledrivetokenrefresher.cpp b/backends/cloud/googledrive/googledrivetokenrefresher.cpp
index 1b858504c5..99661c262e 100644
--- a/backends/cloud/googledrive/googledrivetokenrefresher.cpp
+++ b/backends/cloud/googledrive/googledrivetokenrefresher.cpp
@@ -69,7 +69,7 @@ void GoogleDriveTokenRefresher::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, "GoogleDriveTokenRefresher: code = %ld", httpResponseCode);
}
Common::JSONObject error = result.getVal("error")->asObject();
@@ -79,12 +79,12 @@ void GoogleDriveTokenRefresher::finishJson(Common::JSONValue *json) {
Common::String message;
if (error.contains("code") && error.getVal("code")->isIntegerNumber()) {
code = error.getVal("code")->asIntegerNumber();
- debug(9, "code = %u", code);
+ debug(9, "GoogleDriveTokenRefresher: code = %u", code);
}
if (error.contains("message")) {
message = error.getVal("message")->asString();
- debug(9, "message = %s", message.c_str());
+ debug(9, "GoogleDriveTokenRefresher: message = %s", message.c_str());
}
if (code == 401 || message == "Invalid Credentials")
diff --git a/backends/cloud/googledrive/googledriveuploadrequest.cpp b/backends/cloud/googledrive/googledriveuploadrequest.cpp
index bd9d8790ed..14f43eecde 100644
--- a/backends/cloud/googledrive/googledriveuploadrequest.cpp
+++ b/backends/cloud/googledrive/googledriveuploadrequest.cpp
@@ -305,13 +305,13 @@ void GoogleDriveUploadRequest::partUploadedCallback(Networking::JsonResponse res
}
if (_contentsStream->eos() || _contentsStream->pos() >= _contentsStream->size() - 1) {
- warning("no file info to return");
+ warning("GoogleDriveUploadRequest: no file info to return");
finishUpload(StorageFile(_savePath, 0, 0, false));
} else {
uploadNextPart();
}
} else {
- warning("null, not json");
+ warning("GoogleDriveUploadRequest: null, not json");
finishError(error);
}