Skip to content

Commit eef4a3e

Browse files
committed
changed log tag
1 parent 45961f9 commit eef4a3e

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

src/aws-cpp-sdk-core/include/aws/core/config/EndpointResolver.h

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ namespace Aws
1818
{
1919
namespace Config
2020
{
21+
static const char ENDPOINT_RESOLVER_TAG[] = "EndpointResolver";
22+
2123
/**
2224
* Resolver that sources endpoints and sets them on endpoint providers.
2325
*/
@@ -39,12 +41,11 @@ namespace Aws
3941
const Aws::Http::Scheme& scheme)
4042
{
4143
const Aws::String serviceKey = ToEnvSuffix(serviceId);
42-
static const char* LOG_TAG = "EndpointResolver";
4344

4445
// 1) Check ignore flag from environment variable
4546
Aws::String ignoreEnv = Aws::Environment::GetEnv("AWS_IGNORE_CONFIGURED_ENDPOINT_URLS");
4647
if (!ignoreEnv.empty() && Utils::StringUtils::ConvertToBool(ignoreEnv.c_str())) {
47-
AWS_LOGSTREAM_DEBUG(LOG_TAG, "Configured endpoints ignored due to AWS_IGNORE_CONFIGURED_ENDPOINT_URLS=true");
48+
AWS_LOGSTREAM_DEBUG(ENDPOINT_RESOLVER_TAG, "Configured endpoints ignored due to AWS_IGNORE_CONFIGURED_ENDPOINT_URLS=true");
4849
return;
4950
}
5051

@@ -53,7 +54,7 @@ namespace Aws
5354
Profile profile = GetCachedConfigProfile(profileName);
5455
const Aws::String ignoreVal = profile.GetValue("ignore_configured_endpoint_urls");
5556
if (!ignoreVal.empty() && Utils::StringUtils::ConvertToBool(ignoreVal.c_str())) {
56-
AWS_LOGSTREAM_DEBUG(LOG_TAG, "Configured endpoints ignored due to ignore_configured_endpoint_urls=true in profile: " << profileName);
57+
AWS_LOGSTREAM_DEBUG(ENDPOINT_RESOLVER_TAG, "Configured endpoints ignored due to ignore_configured_endpoint_urls=true in profile: " << profileName);
5758
return;
5859
}
5960
}
@@ -64,8 +65,8 @@ namespace Aws
6465
service += serviceKey;
6566
Aws::String fromEnv = Aws::Environment::GetEnv(service.c_str());
6667
if (!fromEnv.empty()) {
67-
AWS_LOGSTREAM_DEBUG(LOG_TAG, "Resolved configured endpoint from service-specific environment variable: " << service);
68-
AWS_LOGSTREAM_TRACE(LOG_TAG, "Configured endpoint URL: " << fromEnv);
68+
AWS_LOGSTREAM_DEBUG(ENDPOINT_RESOLVER_TAG, "Resolved configured endpoint from service-specific environment variable: " << service);
69+
AWS_LOGSTREAM_TRACE(ENDPOINT_RESOLVER_TAG, "Configured endpoint URL: " << fromEnv);
6970
endpointProvider.OverrideEndpoint(fromEnv, scheme);
7071
return;
7172
}
@@ -75,16 +76,16 @@ namespace Aws
7576
{
7677
Aws::String fromEnv = Aws::Environment::GetEnv("AWS_ENDPOINT_URL");
7778
if (!fromEnv.empty()) {
78-
AWS_LOGSTREAM_DEBUG(LOG_TAG, "Resolved configured endpoint from global environment variable: AWS_ENDPOINT_URL");
79-
AWS_LOGSTREAM_TRACE(LOG_TAG, "Configured endpoint URL: " << fromEnv);
79+
AWS_LOGSTREAM_DEBUG(ENDPOINT_RESOLVER_TAG, "Resolved configured endpoint from global environment variable: AWS_ENDPOINT_URL");
80+
AWS_LOGSTREAM_TRACE(ENDPOINT_RESOLVER_TAG, "Configured endpoint URL: " << fromEnv);
8081
endpointProvider.OverrideEndpoint(fromEnv, scheme);
8182
return;
8283
}
8384
}
8485

8586
// Skip profile resolution no profile available
8687
if (profileName.empty() || !HasCachedConfigProfile(profileName)) {
87-
AWS_LOGSTREAM_DEBUG(LOG_TAG, "No configured endpoint found - no profile available or profile not cached");
88+
AWS_LOGSTREAM_DEBUG(ENDPOINT_RESOLVER_TAG, "No configured endpoint found - no profile available or profile not cached");
8889
return;
8990
}
9091

@@ -94,22 +95,22 @@ namespace Aws
9495
const auto& endpoints = profile.GetServices().GetEndpoints();
9596
auto it = endpoints.find(serviceKey);
9697
if (it != endpoints.end() && !it->second.empty()) {
97-
AWS_LOGSTREAM_DEBUG(LOG_TAG, "Resolved configured endpoint from service-specific profile setting for service: " << serviceKey << " in profile: " << profileName);
98-
AWS_LOGSTREAM_TRACE(LOG_TAG, "Configured endpoint URL: " << it->second);
98+
AWS_LOGSTREAM_DEBUG(ENDPOINT_RESOLVER_TAG, "Resolved configured endpoint from service-specific profile setting for service: " << serviceKey << " in profile: " << profileName);
99+
AWS_LOGSTREAM_TRACE(ENDPOINT_RESOLVER_TAG, "Configured endpoint URL: " << it->second);
99100
endpointProvider.OverrideEndpoint(it->second, scheme);
100101
return;
101102
}
102103

103104
// 5) Global profile endpoint
104105
auto endpoint = profile.GetGlobalEndpointUrl();
105106
if (!endpoint.empty()) {
106-
AWS_LOGSTREAM_DEBUG(LOG_TAG, "Resolved configured endpoint from global profile setting in profile: " << profileName);
107-
AWS_LOGSTREAM_TRACE(LOG_TAG, "Configured endpoint URL: " << endpoint);
107+
AWS_LOGSTREAM_DEBUG(ENDPOINT_RESOLVER_TAG, "Resolved configured endpoint from global profile setting in profile: " << profileName);
108+
AWS_LOGSTREAM_TRACE(ENDPOINT_RESOLVER_TAG, "Configured endpoint URL: " << endpoint);
108109
endpointProvider.OverrideEndpoint(endpoint, scheme);
109110
return;
110111
}
111112

112-
AWS_LOGSTREAM_DEBUG(LOG_TAG, "No configured endpoint found for service: " << serviceId);
113+
AWS_LOGSTREAM_DEBUG(ENDPOINT_RESOLVER_TAG, "No configured endpoint found for service: " << serviceId);
113114
}
114115

115116
private:

0 commit comments

Comments
 (0)