1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:18:12 +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

@ -109,7 +109,7 @@ static constexpr auto s_webdriver_endpoints = Array {
// https://w3c.github.io/webdriver/#dfn-match-a-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();
Vector<String> parameters;
@ -128,7 +128,7 @@ static ErrorOr<MatchedRoute, Error> match_route(HTTP::HttpRequest const& request
};
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())
continue;
@ -156,7 +156,7 @@ static ErrorOr<MatchedRoute, Error> match_route(HTTP::HttpRequest const& request
}
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) };
}
}