update log level from Retry policy (#3586)

* update log level

* Update sdk/core/azure-core/CHANGELOG.md

Co-authored-by: Ahson Khan <ahkha@microsoft.com>

Co-authored-by: Ahson Khan <ahkha@microsoft.com>
This commit is contained in:
Victor Vazquez 2022-04-25 15:53:58 -07:00 committed by GitHub
parent bdb71249ce
commit d799012230
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -12,6 +12,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

View File

@ -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.");
}

View File

@ -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.");
}