From 7e04160b0ba9268dd007cde70a5ad42b31d990a9 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Sun, 12 Dec 2021 10:16:51 -0700 Subject: [PATCH] LibSanitizer: Log UBSAN errors in red text to the debug console This makes them harder to miss for spammy apps when UBSAN is not deadly. Don't commit to making the warnln red at the momment, because that would probably be a nuisance if stderr is not a tty. --- Userland/Libraries/LibSanitizer/UBSanitizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibSanitizer/UBSanitizer.cpp b/Userland/Libraries/LibSanitizer/UBSanitizer.cpp index 95efa03348..ebcf48bf65 100644 --- a/Userland/Libraries/LibSanitizer/UBSanitizer.cpp +++ b/Userland/Libraries/LibSanitizer/UBSanitizer.cpp @@ -13,7 +13,7 @@ bool AK::UBSanitizer::g_ubsan_is_deadly { false }; #define WARNLN_AND_DBGLN(fmt, ...) \ warnln(fmt, ##__VA_ARGS__); \ - dbgln(fmt, ##__VA_ARGS__); + dbgln("\x1B[31m" fmt "\x1B[0m", ##__VA_ARGS__); extern "C" {