From 24445374b296072ce70699cf96f5b8371c97c729 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 28 Mar 2017 11:48:52 +1000 Subject: test: highlight the various state machines with colors Makes visual identification easier Signed-off-by: Peter Hutterer --- test/litest.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/litest.c b/test/litest.c index acba871..c7869e8 100644 --- a/test/litest.c +++ b/test/litest.c @@ -800,7 +800,7 @@ litest_log_handler(struct libinput *libinput, break; case LIBINPUT_LOG_PRIORITY_ERROR: priority = "error"; - color = ANSI_RED; + color = ANSI_BRIGHT_RED; break; case LIBINPUT_LOG_PRIORITY_DEBUG: priority = "debug"; @@ -815,6 +815,25 @@ litest_log_handler(struct libinput *libinput, if (had_newline) fprintf(stderr, "%slitest %s ", color, priority); + + if (strstr(format, "tap state:")) + color = ANSI_BLUE; + else if (strstr(format, "thumb state:")) + color = ANSI_YELLOW; + else if (strstr(format, "button state:")) + color = ANSI_MAGENTA; + else if (strstr(format, "touch-size:") || + strstr(format, "pressure:")) + color = ANSI_GREEN; + else if (strstr(format, "palm:") || + strstr(format, "thumb:")) + color = ANSI_CYAN; + else if (strstr(format, "edge state:")) + color = ANSI_BRIGHT_GREEN; + + if (is_tty) + fprintf(stderr, "%s ", color); + vfprintf(stderr, format, args); had_newline = strlen(format) >= 1 && format[strlen(format) - 1] == '\n'; -- cgit v1.2.3