LibWeb: Don't print messages from workers to the console twice

Previously, any message logged to the console within a worker with a
log level greater than trace was printed twice.
This commit is contained in:
Tim Ledbetter 2024-10-07 16:38:58 +01:00 committed by Andreas Kling
parent 598fabbdd3
commit d0008ae5e0
Notes: github-actions[bot] 2024-10-07 19:23:04 +00:00

View file

@ -62,29 +62,6 @@ JS::ThrowCompletionOr<JS::Value> WorkerDebugConsoleClient::printer(JS::Console::
auto output = TRY(generically_format_values(arguments.get<JS::MarkedVector<JS::Value>>())); auto output = TRY(generically_format_values(arguments.get<JS::MarkedVector<JS::Value>>()));
m_console->output_debug_message(log_level, output); m_console->output_debug_message(log_level, output);
switch (log_level) {
case JS::Console::LogLevel::Debug:
dbgln("{}\033[36;1m{}\033[0m", indent, output);
break;
case JS::Console::LogLevel::Error:
case JS::Console::LogLevel::Assert:
dbgln("{}\033[31;1m{}\033[0m", indent, output);
break;
case JS::Console::LogLevel::Info:
dbgln("{}(i) {}", indent, output);
break;
case JS::Console::LogLevel::Log:
dbgln("{}{}", indent, output);
break;
case JS::Console::LogLevel::Warn:
case JS::Console::LogLevel::CountReset:
dbgln("{}\033[33;1m{}\033[0m", indent, output);
break;
default:
dbgln("{}{}", indent, output);
break;
}
return JS::js_undefined(); return JS::js_undefined();
} }