Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update log level from Retry policy #3586

Merged
merged 2 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sdk/core/azure-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Other Changes

- [[#3581]](https://github.com/Azure/azure-sdk-for-cpp/issues/3581) Update log level in retry policy from warning to informational.

## 1.5.0 (2022-03-31)

### Features Added
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/azure-core/src/http/retry_policy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,10 @@ bool RetryPolicy::ShouldRetryOnResponse(
auto const sc = response.GetStatusCode();
if (statusCodes.find(sc) == statusCodes.end())
{
if (Log::ShouldWrite(Logger::Level::Warning))
if (Log::ShouldWrite(Logger::Level::Informational))
{
Log::Write(
Logger::Level::Warning,
Logger::Level::Informational,
std::string("HTTP status code ") + std::to_string(static_cast<int>(sc))
+ " won't be retried.");
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/azure-core/test/ut/retry_policy_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,6 @@ TEST(RetryPolicy, LogMessages)
EXPECT_EQ(log.Entries[3].Level, Logger::Level::Informational);
EXPECT_EQ(log.Entries[3].Message, "HTTP Retry attempt #2 will be made in 0ms.");

EXPECT_EQ(log.Entries[4].Level, Logger::Level::Warning);
EXPECT_EQ(log.Entries[4].Level, Logger::Level::Informational);
EXPECT_EQ(log.Entries[4].Message, "HTTP status code 503 won't be retried.");
}