mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Colorize log message for failed assertions
The log message can be hard to spot in a sea of debug messages. Colorize it to make the message more immediately pop out.
This commit is contained in:
parent
acc0fb7a47
commit
0eaf13bae3
Notes:
sideshowbarker
2024-07-17 01:46:43 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/0eaf13bae3 Pull-request: https://github.com/SerenityOS/serenity/pull/21520 Reviewed-by: https://github.com/ADKaster
1 changed files with 11 additions and 1 deletions
|
@ -89,7 +89,17 @@ extern "C" {
|
|||
|
||||
void ak_verification_failed(char const* message)
|
||||
{
|
||||
ERRORLN("VERIFICATION FAILED: {}", message);
|
||||
# if defined(AK_OS_SERENITY) || defined(AK_OS_ANDROID)
|
||||
bool colorize_output = true;
|
||||
# else
|
||||
bool colorize_output = isatty(STDERR_FILENO) == 1;
|
||||
# endif
|
||||
|
||||
if (colorize_output)
|
||||
ERRORLN("\033[31;1mVERIFICATION FAILED\033[0m: {}", message);
|
||||
else
|
||||
ERRORLN("VERIFICATION FAILED: {}", message);
|
||||
|
||||
# if defined(EXECINFO_BACKTRACE)
|
||||
dump_backtrace();
|
||||
# endif
|
||||
|
|
Loading…
Reference in a new issue