From c4cb4da33afb5a1bb16637ba1f07371b25f9e981 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 27 Mar 2020 21:26:05 +1000 Subject: [PATCH] util: make the trace macro actually useful This has been there for years and I never used it. Much better to convert it to a generically useful one (i.e. one that prints red so it's easy to see) and make it unconditional. Signed-off-by: Peter Hutterer --- src/libinput-util.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/libinput-util.h b/src/libinput-util.h index 116e3e96..76da5aeb 100644 --- a/src/libinput-util.h +++ b/src/libinput-util.h @@ -57,15 +57,12 @@ #define DEFAULT_MOUSE_DPI 1000 #define DEFAULT_TRACKPOINT_SENSITIVITY 128 -#ifdef DEBUG_TRACE -#define debug_trace(...) \ +#define trace(...) \ do { \ - printf("%s:%d %s() - ", __FILE__, __LINE__, __func__); \ + printf("%s() - \033[0;31m", __func__); \ printf(__VA_ARGS__); \ + printf("\033[0m"); \ } while (0) -#else -#define debug_trace(...) { } -#endif #define LIBINPUT_EXPORT __attribute__ ((visibility("default")))