Skip to content

Commit

Permalink
Show more log info in prod build (#1431) (#1431)
Browse files Browse the repository at this point in the history
Change log level for error message when max number of
HTTP requests has been reached. Add status code for failed
HTTP requests.

Relates-To: IOTSDK-19103

Signed-off-by: Nazar Kacharaba <ext-nazar.kacharaba@here.com>
  • Loading branch information
NazarKacharaba authored Sep 14, 2023
1 parent 3a3021b commit 3146857
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
12 changes: 6 additions & 6 deletions olp-cpp-sdk-core/src/http/ios/OLPNetworkIOS.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2021 HERE Europe B.V.
* Copyright (C) 2019-2023 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -142,11 +142,11 @@
{
std::lock_guard<std::mutex> lock(mutex_);
if (http_client_.activeTasks.count >= max_requests_count_) {
OLP_SDK_LOG_DEBUG_F(kLogTag,
"Send failed - reached max requests "
"count=%lu/%lu, url=%s",
http_client_.activeTasks.count, max_requests_count_,
request.GetUrl().c_str());
OLP_SDK_LOG_WARNING_F(kLogTag,
"Send failed - reached max requests "
"count=%lu/%lu, url=%s",
http_client_.activeTasks.count, max_requests_count_,
request.GetUrl().c_str());
return SendOutcome(ErrorCode::NETWORK_OVERLOAD_ERROR);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2022 HERE Europe B.V.
* Copyright (C) 2019-2023 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -417,8 +417,9 @@ PrefetchTilesRepository::DownloadVersionedQuadTree(

if (quad_tree.status != olp::http::HttpStatusCode::OK) {
OLP_SDK_LOG_WARNING_F(kLogTag,
"GetSubQuads failed(%s, %" PRId64 ", %" PRId32 ")",
tile_key.c_str(), version, depth);
"GetSubQuads failed(%s, %" PRId64 ", %" PRId32
"), status_code='%d'",
tile_key.c_str(), version, depth, quad_tree.status);
return QuadTreeResponse(
client::ApiError(quad_tree.status, quad_tree.response.str()),
quad_tree.GetNetworkStatistics());
Expand Down

0 comments on commit 3146857

Please sign in to comment.