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

LibJS+js: Disable console debug messages outside Serenity only for js

Previously we would disable console debug messages on all non Serenity
platforms as it caused double printing on lagom `js`. This patch limits
this to the `js` utility, allowing LibWeb to print debug messages
regardless of the operating system :^)
This commit is contained in:
networkException 2022-10-15 22:38:31 +02:00 committed by Ali Mohammad Pur
parent 5e26bb7643
commit afeff4cebb
3 changed files with 4 additions and 4 deletions

View file

@ -427,9 +427,8 @@ MarkedVector<Value> Console::vm_arguments()
return arguments;
}
void Console::output_debug_message([[maybe_unused]] LogLevel log_level, [[maybe_unused]] String output) const
void Console::output_debug_message(LogLevel log_level, String const& output) const
{
#ifdef AK_OS_SERENITY
switch (log_level) {
case Console::LogLevel::Debug:
dbgln("\033[32;1m(js debug)\033[0m {}", output);
@ -450,7 +449,6 @@ void Console::output_debug_message([[maybe_unused]] LogLevel log_level, [[maybe_
dbgln("\033[32;1m(js)\033[0m {}", output);
break;
}
#endif
}
void Console::report_exception(JS::Error const& exception, bool in_promise) const