1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:57:44 +00:00

LibWeb: Hide WebDriver::match_route debug behind its own flag

When enabling WEBDRIVER_DEBUG globally, this function's debug spam
overpowers the rest of the useful logs.
This commit is contained in:
Andrew Kaster 2024-02-07 08:06:55 -07:00 committed by Andreas Kling
parent f739e976a4
commit bc9c710904
4 changed files with 9 additions and 3 deletions

View file

@ -530,6 +530,10 @@
# cmakedefine01 WEBDRIVER_DEBUG # cmakedefine01 WEBDRIVER_DEBUG
#endif #endif
#ifndef WEBDRIVER_ROUTE_DEBUG
# cmakedefine01 WEBDRIVER_ROUTE_DEBUG
#endif
#ifndef WEBGL_CONTEXT_DEBUG #ifndef WEBGL_CONTEXT_DEBUG
# cmakedefine01 WEBGL_CONTEXT_DEBUG # cmakedefine01 WEBGL_CONTEXT_DEBUG
#endif #endif

View file

@ -212,6 +212,7 @@ set(WASM_BINPARSER_DEBUG ON)
set(WASM_TRACE_DEBUG ON) set(WASM_TRACE_DEBUG ON)
set(WASM_VALIDATOR_DEBUG ON) set(WASM_VALIDATOR_DEBUG ON)
set(WEBDRIVER_DEBUG ON) set(WEBDRIVER_DEBUG ON)
set(WEBDRIVER_ROUTE_DEBUG ON)
set(WEBGL_CONTEXT_DEBUG ON) set(WEBGL_CONTEXT_DEBUG ON)
set(WEBSERVER_DEBUG ON) set(WEBSERVER_DEBUG ON)
set(WEB_FETCH_DEBUG ON) set(WEB_FETCH_DEBUG ON)

View file

@ -363,6 +363,7 @@ write_cmake_config("ak_debug_gen") {
"WASM_TRACE_DEBUG=", "WASM_TRACE_DEBUG=",
"WASM_VALIDATOR_DEBUG=", "WASM_VALIDATOR_DEBUG=",
"WEBDRIVER_DEBUG=", "WEBDRIVER_DEBUG=",
"WEBDRIVER_ROUTE_DEBUG=",
"WEBGL_CONTEXT_DEBUG=", "WEBGL_CONTEXT_DEBUG=",
"WEBP_DEBUG=", "WEBP_DEBUG=",
"WEBSERVER_DEBUG=", "WEBSERVER_DEBUG=",

View file

@ -109,7 +109,7 @@ static constexpr auto s_webdriver_endpoints = Array {
// https://w3c.github.io/webdriver/#dfn-match-a-request // https://w3c.github.io/webdriver/#dfn-match-a-request
static ErrorOr<MatchedRoute, Error> match_route(HTTP::HttpRequest const& request) static ErrorOr<MatchedRoute, Error> match_route(HTTP::HttpRequest const& request)
{ {
dbgln_if(WEBDRIVER_DEBUG, "match_route({}, {})", HTTP::to_string_view(request.method()), request.resource()); dbgln_if(WEBDRIVER_ROUTE_DEBUG, "match_route({}, {})", HTTP::to_string_view(request.method()), request.resource());
auto request_path = request.resource().view(); auto request_path = request.resource().view();
Vector<String> parameters; Vector<String> parameters;
@ -128,7 +128,7 @@ static ErrorOr<MatchedRoute, Error> match_route(HTTP::HttpRequest const& request
}; };
for (auto const& route : s_webdriver_endpoints) { for (auto const& route : s_webdriver_endpoints) {
dbgln_if(WEBDRIVER_DEBUG, "- Checking {} {}", HTTP::to_string_view(route.method), route.path); dbgln_if(WEBDRIVER_ROUTE_DEBUG, "- Checking {} {}", HTTP::to_string_view(route.method), route.path);
if (route.method != request.method()) if (route.method != request.method())
continue; continue;
@ -156,7 +156,7 @@ static ErrorOr<MatchedRoute, Error> match_route(HTTP::HttpRequest const& request
} }
if (*match) { if (*match) {
dbgln_if(WEBDRIVER_DEBUG, "- Found match with parameters={}", parameters); dbgln_if(WEBDRIVER_ROUTE_DEBUG, "- Found match with parameters={}", parameters);
return MatchedRoute { route.handler, move(parameters) }; return MatchedRoute { route.handler, move(parameters) };
} }
} }