mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:17:45 +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:
parent
f739e976a4
commit
bc9c710904
4 changed files with 9 additions and 3 deletions
|
@ -530,6 +530,10 @@
|
|||
# cmakedefine01 WEBDRIVER_DEBUG
|
||||
#endif
|
||||
|
||||
#ifndef WEBDRIVER_ROUTE_DEBUG
|
||||
# cmakedefine01 WEBDRIVER_ROUTE_DEBUG
|
||||
#endif
|
||||
|
||||
#ifndef WEBGL_CONTEXT_DEBUG
|
||||
# cmakedefine01 WEBGL_CONTEXT_DEBUG
|
||||
#endif
|
||||
|
|
|
@ -212,6 +212,7 @@ set(WASM_BINPARSER_DEBUG ON)
|
|||
set(WASM_TRACE_DEBUG ON)
|
||||
set(WASM_VALIDATOR_DEBUG ON)
|
||||
set(WEBDRIVER_DEBUG ON)
|
||||
set(WEBDRIVER_ROUTE_DEBUG ON)
|
||||
set(WEBGL_CONTEXT_DEBUG ON)
|
||||
set(WEBSERVER_DEBUG ON)
|
||||
set(WEB_FETCH_DEBUG ON)
|
||||
|
|
|
@ -363,6 +363,7 @@ write_cmake_config("ak_debug_gen") {
|
|||
"WASM_TRACE_DEBUG=",
|
||||
"WASM_VALIDATOR_DEBUG=",
|
||||
"WEBDRIVER_DEBUG=",
|
||||
"WEBDRIVER_ROUTE_DEBUG=",
|
||||
"WEBGL_CONTEXT_DEBUG=",
|
||||
"WEBP_DEBUG=",
|
||||
"WEBSERVER_DEBUG=",
|
||||
|
|
|
@ -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) };
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue