util: make the trace macro actually useful
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 27 Mar 2020 11:26:05 +0000 (21:26 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Sat, 4 Apr 2020 11:10:40 +0000 (21:10 +1000)
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 <peter.hutterer@who-t.net>
src/libinput-util.h

index 116e3e968eb082265bedb53999d775aea1614288..76da5aeb646dd87738c34d781022d8b15dbcb8ac 100644 (file)
 #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")))