Skip to content

Commit 713cf8d

Browse files
Change log messages severity
Mainly change Debug to Trace where no additional data provided except input arguments Relates-To: DATASDK-55 Signed-off-by: Rustam Gamidov <[email protected]>
1 parent 3df36bc commit 713cf8d

File tree

14 files changed

+65
-61
lines changed

14 files changed

+65
-61
lines changed

olp-cpp-sdk-authentication/include/olp/authentication/TokenResult.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class AUTHENTICATION_API TokenResult {
5454
*
5555
* @param access_token The access token issued by the authorization server.
5656
* @param expires_in The expiry time of the access token.
57-
* @param scop The scope assigned to the access token.
57+
* @param scope The scope assigned to the access token.
5858
*/
5959
TokenResult(std::string access_token, std::chrono::seconds expires_in,
6060
boost::optional<std::string> scope);

olp-cpp-sdk-core/src/cache/DefaultCacheImpl.cpp

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -549,10 +549,10 @@ uint64_t DefaultCacheImpl::MaybeEvictData() {
549549
call_evict_method(std::mem_fn(&DefaultCacheImpl::EvictDataPortion));
550550
}
551551

552-
OLP_SDK_LOG_INFO_F(kLogTag,
553-
"Evicted from mutable cache, items=%" PRId32
554-
", time=%" PRId64 "us, size=%" PRIu64,
555-
count, GetElapsedTime(start), evicted);
552+
OLP_SDK_LOG_DEBUG_F(kLogTag,
553+
"Evicted from mutable cache, items=%" PRId32
554+
", time=%" PRId64 "us, size=%" PRIu64,
555+
count, GetElapsedTime(start), evicted);
556556

557557
return evicted;
558558
}
@@ -594,10 +594,11 @@ DefaultCacheImpl::EvictionResult DefaultCacheImpl::EvictExpiredDataPortion(
594594
it = mutable_cache_lru_->Erase(it);
595595
}
596596

597-
OLP_SDK_LOG_DEBUG_F(kLogTag,
597+
OLP_SDK_LOG_TRACE_F(kLogTag,
598598
"EvictExpiredDataPortion(): Evicted successfully, "
599599
"count=%d, evicted=%" PRIu64,
600600
count, evicted);
601+
601602
return {count, evicted};
602603
}
603604

@@ -633,10 +634,11 @@ DefaultCacheImpl::EvictionResult DefaultCacheImpl::EvictDataPortion(
633634
it = mutable_cache_lru_->rbegin();
634635
}
635636

636-
OLP_SDK_LOG_DEBUG_F(
637+
OLP_SDK_LOG_TRACE_F(
637638
kLogTag,
638639
"EvictDataPortion(): Evicted successfully, count=%u, evicted=%" PRIu64,
639640
count, evicted);
641+
640642
return {count, evicted};
641643
}
642644

@@ -942,12 +944,13 @@ bool DefaultCacheImpl::Protect(const DefaultCache::KeyListType& keys) {
942944
memory_cache_->Clear();
943945
}
944946

945-
OLP_SDK_LOG_INFO_F(kLogTag,
946-
"Protect, time=%" PRId64 "us, added keys size=%" PRIu64
947-
", total size=%" PRIu64,
948-
GetElapsedTime(start),
949-
static_cast<std::uint64_t>(keys.size()),
950-
protected_keys_.Count());
947+
OLP_SDK_LOG_DEBUG_F(kLogTag,
948+
"Protect, time=%" PRId64 "us, added keys size=%" PRIu64
949+
", total size=%" PRIu64,
950+
GetElapsedTime(start),
951+
static_cast<std::uint64_t>(keys.size()),
952+
protected_keys_.Count());
953+
951954
return result;
952955
}
953956

@@ -988,12 +991,13 @@ bool DefaultCacheImpl::Release(const DefaultCache::KeyListType& keys) {
988991
}
989992
}
990993

991-
OLP_SDK_LOG_INFO_F(kLogTag,
992-
"Release, time=%" PRId64 "us, released keys size=%" PRIu64
993-
", total size=%" PRIu64,
994-
GetElapsedTime(start),
995-
static_cast<std::uint64_t>(keys.size()),
996-
protected_keys_.Count());
994+
OLP_SDK_LOG_DEBUG_F(kLogTag,
995+
"Release, time=%" PRId64 "us, released keys size=%" PRIu64
996+
", total size=%" PRIu64,
997+
GetElapsedTime(start),
998+
static_cast<std::uint64_t>(keys.size()),
999+
protected_keys_.Count());
1000+
9971001
return result;
9981002
}
9991003

olp-cpp-sdk-core/src/client/repository/ApiCacheRepository.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2020-2021 HERE Europe B.V.
2+
* Copyright (C) 2020-2024 HERE Europe B.V.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@ void ApiCacheRepository::Put(const std::string& service,
3939
const std::string& version, const std::string& url,
4040
boost::optional<time_t> expiry) {
4141
const auto key = cache::KeyGenerator::CreateApiKey(hrn_, service, version);
42-
OLP_SDK_LOG_DEBUG_F(kLogTag, "Put -> '%s'", key.c_str());
42+
OLP_SDK_LOG_TRACE_F(kLogTag, "Put -> '%s'", key.c_str());
4343

4444
cache_->Put(key, url, [&]() { return url; },
4545
expiry.get_value_or(kLookupApiExpiryTime));
@@ -48,7 +48,7 @@ void ApiCacheRepository::Put(const std::string& service,
4848
boost::optional<std::string> ApiCacheRepository::Get(
4949
const std::string& service, const std::string& version) {
5050
const auto key = cache::KeyGenerator::CreateApiKey(hrn_, service, version);
51-
OLP_SDK_LOG_DEBUG_F(kLogTag, "Get -> '%s'", key.c_str());
51+
OLP_SDK_LOG_TRACE_F(kLogTag, "Get -> '%s'", key.c_str());
5252

5353
auto url = cache_->Get(key, [](const std::string& value) { return value; });
5454
if (url.empty()) {

olp-cpp-sdk-dataservice-read/src/ApiClientLookup.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ ApiClientLookup::ApiClientResponse ApiClientLookup::LookupApi(
7474
if (options != OnlineOnly && options != CacheWithUpdate) {
7575
auto url = repository.Get(service, service_version);
7676
if (url) {
77-
OLP_SDK_LOG_DEBUG_F(kLogTag, "LookupApi(%s/%s) found in cache, hrn='%s'",
77+
OLP_SDK_LOG_TRACE_F(kLogTag, "LookupApi(%s/%s) found in cache, hrn='%s'",
7878
service.c_str(), service_version.c_str(),
7979
hrn.c_str());
8080
client::OlpClient client(settings, *url);
@@ -132,7 +132,7 @@ ApiClientLookup::ApiClientResponse ApiClientLookup::LookupApi(
132132

133133
const auto& service_url = it->GetBaseUrl();
134134

135-
OLP_SDK_LOG_DEBUG_F(kLogTag,
135+
OLP_SDK_LOG_TRACE_F(kLogTag,
136136
"LookupApi(%s/%s) found, hrn='%s', service_url='%s'",
137137
service.c_str(), service_version.c_str(), hrn.c_str(),
138138
service_url.c_str());

olp-cpp-sdk-dataservice-read/src/VersionedLayerClientImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ client::CancellationToken VersionedLayerClientImpl::PrefetchTiles(
491491
return;
492492
}
493493

494-
OLP_SDK_LOG_DEBUG_F(kLogTag, "PrefetchTiles: subquads=%zu, key=%s",
494+
OLP_SDK_LOG_TRACE_F(kLogTag, "PrefetchTiles: subquads=%zu, key=%s",
495495
sliced_tiles.size(), key.c_str());
496496

497497
const bool aggregation_enabled = request.GetDataAggregationEnabled();

olp-cpp-sdk-dataservice-read/src/VolatileLayerClientImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ client::CancellationToken VolatileLayerClientImpl::PrefetchTiles(
199199
return;
200200
}
201201

202-
OLP_SDK_LOG_INFO_F(kLogTag, "PrefetchTiles: using key=%s", key.c_str());
202+
OLP_SDK_LOG_DEBUG_F(kLogTag, "PrefetchTiles: using key=%s", key.c_str());
203203

204204
// Calculate the minimal set of Tile keys and depth to
205205
// cover tree.
@@ -229,7 +229,7 @@ client::CancellationToken VolatileLayerClientImpl::PrefetchTiles(
229229
return;
230230
}
231231

232-
OLP_SDK_LOG_DEBUG_F(kLogTag, "PrefetchTiles, subquads=%zu, key=%s",
232+
OLP_SDK_LOG_TRACE_F(kLogTag, "PrefetchTiles, subquads=%zu, key=%s",
233233
sliced_tiles.size(), key.c_str());
234234

235235
auto query = [=](geo::TileKey root,

olp-cpp-sdk-dataservice-read/src/repositories/ApiCacheRepository.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019-2021 HERE Europe B.V.
2+
* Copyright (C) 2019-2024 HERE Europe B.V.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -41,7 +41,7 @@ void ApiCacheRepository::Put(const std::string& service,
4141
const std::string& url) {
4242
const std::string hrn(hrn_.ToCatalogHRNString());
4343
const auto key = cache::KeyGenerator::CreateApiKey(hrn, service, version);
44-
OLP_SDK_LOG_DEBUG_F(kLogTag, "Put -> '%s'", key.c_str());
44+
OLP_SDK_LOG_TRACE_F(kLogTag, "Put -> '%s'", key.c_str());
4545

4646
cache_->Put(key, url, [&]() { return url; }, kLookupApiExpiryTime);
4747
}
@@ -50,7 +50,7 @@ boost::optional<std::string> ApiCacheRepository::Get(
5050
const std::string& service, const std::string& version) {
5151
const std::string hrn(hrn_.ToCatalogHRNString());
5252
const auto key = cache::KeyGenerator::CreateApiKey(hrn, service, version);
53-
OLP_SDK_LOG_DEBUG_F(kLogTag, "Get -> '%s'", key.c_str());
53+
OLP_SDK_LOG_TRACE_F(kLogTag, "Get -> '%s'", key.c_str());
5454

5555
auto url = cache_->Get(key, [](const std::string& value) { return value; });
5656
if (url.empty()) {

olp-cpp-sdk-dataservice-read/src/repositories/CatalogCacheRepository.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ CatalogCacheRepository::CatalogCacheRepository(
5757
bool CatalogCacheRepository::Put(const model::Catalog& catalog) {
5858
const std::string hrn(hrn_.ToCatalogHRNString());
5959
const auto key = cache::KeyGenerator::CreateCatalogKey(hrn);
60-
OLP_SDK_LOG_DEBUG_F(kLogTag, "Put -> '%s'", key.c_str());
60+
OLP_SDK_LOG_TRACE_F(kLogTag, "Put -> '%s'", key.c_str());
6161

6262
return cache_->Put(key, catalog,
6363
[&]() { return olp::serializer::serialize(catalog); },
@@ -67,7 +67,7 @@ bool CatalogCacheRepository::Put(const model::Catalog& catalog) {
6767
boost::optional<model::Catalog> CatalogCacheRepository::Get() {
6868
const std::string hrn(hrn_.ToCatalogHRNString());
6969
const auto key = cache::KeyGenerator::CreateCatalogKey(hrn);
70-
OLP_SDK_LOG_DEBUG_F(kLogTag, "Get -> '%s'", key.c_str());
70+
OLP_SDK_LOG_TRACE_F(kLogTag, "Get -> '%s'", key.c_str());
7171

7272
auto cached_catalog = cache_->Get(key, [](const std::string& value) {
7373
return parser::parse<model::Catalog>(value);
@@ -83,7 +83,7 @@ boost::optional<model::Catalog> CatalogCacheRepository::Get() {
8383
bool CatalogCacheRepository::PutVersion(const model::VersionResponse& version) {
8484
const std::string hrn(hrn_.ToCatalogHRNString());
8585
const auto key = cache::KeyGenerator::CreateLatestVersionKey(hrn);
86-
OLP_SDK_LOG_DEBUG_F(kLogTag, "PutVersion -> '%s'", key.c_str());
86+
OLP_SDK_LOG_TRACE_F(kLogTag, "PutVersion -> '%s'", key.c_str());
8787

8888
return cache_->Put(key, version,
8989
[&]() { return olp::serializer::serialize(version); },
@@ -93,7 +93,7 @@ bool CatalogCacheRepository::PutVersion(const model::VersionResponse& version) {
9393
boost::optional<model::VersionResponse> CatalogCacheRepository::GetVersion() {
9494
const std::string hrn(hrn_.ToCatalogHRNString());
9595
const auto key = cache::KeyGenerator::CreateLatestVersionKey(hrn);
96-
OLP_SDK_LOG_DEBUG_F(kLogTag, "GetVersion -> '%s'", key.c_str());
96+
OLP_SDK_LOG_TRACE_F(kLogTag, "GetVersion -> '%s'", key.c_str());
9797

9898
auto cached_version = cache_->Get(key, [](const std::string& value) {
9999
return parser::parse<model::VersionResponse>(value);

olp-cpp-sdk-dataservice-read/src/repositories/CatalogRepository.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ CatalogResponse CatalogRepository::GetCatalog(
6565
if (fetch_options != OnlineOnly && fetch_options != CacheWithUpdate) {
6666
auto cached = repository.Get();
6767
if (cached) {
68-
OLP_SDK_LOG_DEBUG_F(kLogTag,
68+
OLP_SDK_LOG_TRACE_F(kLogTag,
6969
"GetCatalog found in cache, hrn='%s', key='%s'",
7070
catalog_str.c_str(), request_key.c_str());
7171

olp-cpp-sdk-dataservice-read/src/repositories/DataCacheRepository.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ client::ApiNoResponse DataCacheRepository::Put(const model::Data& data,
5252
const std::string& data_handle) {
5353
const auto key =
5454
cache::KeyGenerator::CreateDataHandleKey(hrn_, layer_id, data_handle);
55-
OLP_SDK_LOG_DEBUG_F(kLogTag, "Put -> '%s'", key.c_str());
55+
OLP_SDK_LOG_TRACE_F(kLogTag, "Put -> '%s'", key.c_str());
5656

5757
auto write_result = cache_->Write(key, data, default_expiry_);
5858
if (!write_result) {
@@ -67,7 +67,7 @@ boost::optional<model::Data> DataCacheRepository::Get(
6767
const std::string& layer_id, const std::string& data_handle) {
6868
const auto key =
6969
cache::KeyGenerator::CreateDataHandleKey(hrn_, layer_id, data_handle);
70-
OLP_SDK_LOG_DEBUG_F(kLogTag, "Get '%s'", key.c_str());
70+
OLP_SDK_LOG_TRACE_F(kLogTag, "Get '%s'", key.c_str());
7171

7272
auto cached_data = cache_->Get(key);
7373
if (!cached_data) {
@@ -87,7 +87,7 @@ client::ApiNoResponse DataCacheRepository::Clear(
8787
const std::string& layer_id, const std::string& data_handle) {
8888
const auto key =
8989
cache::KeyGenerator::CreateDataHandleKey(hrn_, layer_id, data_handle);
90-
OLP_SDK_LOG_DEBUG_F(kLogTag, "Clear -> '%s'", key.c_str());
90+
OLP_SDK_LOG_TRACE_F(kLogTag, "Clear -> '%s'", key.c_str());
9191
return cache_->DeleteByPrefix(key);
9292
}
9393
void DataCacheRepository::PromoteInCache(const std::string& layer_id,

0 commit comments

Comments
 (0)