Skip to content

Commit 9e226e2

Browse files
committed
fix(logs): no new notification should not be a warning in logs
adjust log level while making sure we do not loose information when querying notifications and they did not change Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
1 parent b0424a3 commit 9e226e2

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/libsync/networkjobs.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,11 +1111,13 @@ void JsonApiJob::start()
11111111

11121112
bool JsonApiJob::finished()
11131113
{
1114-
qCInfo(lcJsonApiJob) << "JsonApiJob of" << reply()->request().url() << "FINISHED WITH STATUS"
1115-
<< replyStatusString();
1116-
11171114
int statusCode = 0;
11181115
int httpStatusCode = reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
1116+
1117+
qCInfo(lcJsonApiJob) << "JsonApiJob of" << reply()->request().url()
1118+
<< "FINISHED WITH STATUS" << replyStatusString()
1119+
<< "with http status code" << httpStatusCode;
1120+
11191121
if (reply()->error() != QNetworkReply::NoError) {
11201122
qCWarning(lcJsonApiJob) << "Network error: " << path() << errorString() << reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute);
11211123
statusCode = reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
@@ -1132,7 +1134,7 @@ bool JsonApiJob::finished()
11321134
statusCode = rexMatch.captured(1).toInt();
11331135
}
11341136
} else if(jsonStr.isEmpty() && httpStatusCode == notModifiedStatusCode){
1135-
qCWarning(lcJsonApiJob) << "Nothing changed so nothing to retrieve - status code: " << httpStatusCode;
1137+
qCDebug(lcJsonApiJob) << "Nothing changed so nothing to retrieve - status code: " << httpStatusCode;
11361138
statusCode = httpStatusCode;
11371139
} else {
11381140
static const QRegularExpression rex(R"("statuscode":(\d+))");

0 commit comments

Comments
 (0)