tools/debug-events: print bugs in bold red
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 1 Nov 2024 06:00:12 +0000 (16:00 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 5 Nov 2024 02:05:05 +0000 (12:05 +1000)
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1013>

tools/shared.c

index 06f027c1fbf4695c7aed94dfc492aadfa077e557..9df277d676f755c059ef7c7f2e8df0e2cd155d3b 100644 (file)
@@ -70,7 +70,12 @@ log_handler(struct libinput *li,
 
        if (is_tty) {
                if (priority >= LIBINPUT_LOG_PRIORITY_ERROR) {
-                       printf(ANSI_RED);
+                       if (strstr(format, "client bug: ") ||
+                           strstr(format, "libinput bug: ") ||
+                           strstr(format, "kernel bug: "))
+                               printf(ANSI_BRIGHT_RED);
+                       else
+                               printf(ANSI_RED);
                } else if (priority >= LIBINPUT_LOG_PRIORITY_INFO) {
                        printf(ANSI_HIGHLIGHT);
                } else if (priority == LIBINPUT_LOG_PRIORITY_DEBUG) {