aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp/servers/httpasio.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-02-17 13:56:33 +0100
committerGitHub Enterprise <[email protected]>2026-02-17 13:56:33 +0100
commit2159b2ce105935ce4d52a726094f9bbb91537d0c (patch)
tree6f8b21486d6dfa4e7d188bd83a56cbfdf4436b22 /src/zenhttp/servers/httpasio.cpp
parentadded ResetConsoleLog (#758) (diff)
downloadzen-2159b2ce105935ce4d52a726094f9bbb91537d0c.tar.xz
zen-2159b2ce105935ce4d52a726094f9bbb91537d0c.zip
misc fixes brought over from sb/proto (#759)
* `RwLock::WithSharedLock` and `RwLock::WithExclusiveLock` can now return a value (which is returned by the passed function) * Comma-separated logger specification now correctly deals with commas * `GetSystemMetrics` properly accounts for cores * cpr response formatter passes arguments in the right order * `HttpServerRequest::SetLogRequest` can be used to selectively log HTTP requests
Diffstat (limited to 'src/zenhttp/servers/httpasio.cpp')
-rw-r--r--src/zenhttp/servers/httpasio.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/zenhttp/servers/httpasio.cpp b/src/zenhttp/servers/httpasio.cpp
index 230aac6a8..1f42b05d2 100644
--- a/src/zenhttp/servers/httpasio.cpp
+++ b/src/zenhttp/servers/httpasio.cpp
@@ -147,7 +147,7 @@ inline LoggerRef
InitLogger()
{
LoggerRef Logger = logging::Get("asio");
- // Logger.set_level(spdlog::level::trace);
+ // Logger.SetLogLevel(logging::level::Trace);
return Logger;
}
@@ -1264,6 +1264,11 @@ HttpServerConnection::HandleRequest()
if (std::unique_ptr<HttpResponse> Response = std::move(Request.m_Response))
{
+ if (Request.ShouldLogRequest())
+ {
+ ZEN_INFO("{} {} {} -> {}", ToString(RequestVerb), Uri, Response->ResponseCode(), NiceBytes(Response->ContentLength()));
+ }
+
// Transmit the response
if (m_RequestData.RequestVerb() == HttpVerb::kHead)