aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp/clients/httpclientcurl.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2026-04-17 14:10:02 +0200
committerGitHub Enterprise <[email protected]>2026-04-17 14:10:02 +0200
commitbc17147c11d2e34a287a4e2171484aa3f9e576d4 (patch)
tree84f070b4d21fbf46b68ffd59d5d6215f8c2a8876 /src/zenhttp/clients/httpclientcurl.cpp
parentoperationlogoutput refactor (#967) (diff)
downloadarchived-zen-bc17147c11d2e34a287a4e2171484aa3f9e576d4.tar.xz
archived-zen-bc17147c11d2e34a287a4e2171484aa3f9e576d4.zip
log cleanup (#969)
- Improvement: New `ZEN_SCOPED_LOG(Expr)` macro routes `ZEN_INFO`/`ZEN_WARN`/`ZEN_DEBUG` in the enclosing block through the given logger expression instead of the default - Improvement: `BuildContainer`, `SaveOplog`, and `LoadOplogContext` now take a caller-provided `LoggerRef` so diagnostic messages route through the caller's logger
Diffstat (limited to 'src/zenhttp/clients/httpclientcurl.cpp')
-rw-r--r--src/zenhttp/clients/httpclientcurl.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/zenhttp/clients/httpclientcurl.cpp b/src/zenhttp/clients/httpclientcurl.cpp
index 56b9c39c5..3be7337c1 100644
--- a/src/zenhttp/clients/httpclientcurl.cpp
+++ b/src/zenhttp/clients/httpclientcurl.cpp
@@ -88,7 +88,7 @@ CurlDebugCallback(CURL* Handle, curl_infotype Type, char* Data, size_t Size, voi
{
ZEN_UNUSED(Handle);
LoggerRef LogRef = *static_cast<LoggerRef*>(UserPtr);
- auto Log = [&]() -> LoggerRef { return LogRef; };
+ ZEN_SCOPED_LOG(LogRef);
std::string_view DataView(Data, Size);
@@ -964,7 +964,7 @@ CurlHttpClient::Post(std::string_view Url,
std::error_code Ec = (*Data->PayloadFile)->Open(*Data->TempFolderPath, ContentLength.value());
if (Ec)
{
- auto Log = [&]() -> LoggerRef { return Data->Log; };
+ ZEN_SCOPED_LOG(Data->Log);
ZEN_WARN("Failed to create temp file in '{}' for HttpClient::Post. Reason: {}",
Data->TempFolderPath->string(),
Ec.message());
@@ -1017,7 +1017,7 @@ CurlHttpClient::Post(std::string_view Url,
std::error_code Ec = (*Data->PayloadFile)->Write(std::string_view(Ptr, TotalBytes));
if (Ec)
{
- auto Log = [&]() -> LoggerRef { return Data->Log; };
+ ZEN_SCOPED_LOG(Data->Log);
ZEN_WARN("Failed to write to temp file in '{}' for HttpClient::Post. Reason: {}",
Data->TempFolderPath->string(),
Ec.message());
@@ -1283,7 +1283,7 @@ CurlHttpClient::Download(std::string_view Url, const std::filesystem::path& Temp
std::error_code Ec = (*Data->PayloadFile)->Open(*Data->TempFolderPath, ContentLength.value());
if (Ec)
{
- auto Log = [&]() -> LoggerRef { return Data->Log; };
+ ZEN_SCOPED_LOG(Data->Log);
ZEN_WARN("Failed to create temp file in '{}' for HttpClient::Download. Reason: {}",
Data->TempFolderPath->string(),
Ec.message());
@@ -1369,7 +1369,7 @@ CurlHttpClient::Download(std::string_view Url, const std::filesystem::path& Temp
std::error_code Ec = (*Data->PayloadFile)->Write(std::string_view(Ptr, TotalBytes));
if (Ec)
{
- auto Log = [&]() -> LoggerRef { return Data->Log; };
+ ZEN_SCOPED_LOG(Data->Log);
ZEN_WARN("Failed to write to temp file in '{}' for HttpClient::Download. Reason: {}",
Data->TempFolderPath->string(),
Ec.message());