mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-07 11:10:13 +01:00
util: slightly improve the trace() macro
Only one printf call instead of three, means better termination of the color code. And auto-append the newline while we're there and use the ANSI defines we have since added. Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/984>
This commit is contained in:
parent
bb1b1304df
commit
02d01a53c6
1 changed files with 3 additions and 3 deletions
|
|
@ -58,9 +58,9 @@
|
|||
|
||||
#define trace(...) \
|
||||
do { \
|
||||
printf("%s() - \033[0;31m", __func__); \
|
||||
printf(__VA_ARGS__); \
|
||||
printf("\033[0m"); \
|
||||
char buf_[1024]; \
|
||||
snprintf(buf_, sizeof(buf_), __VA_ARGS__); \
|
||||
printf(ANSI_BLUE "%s():%d - " ANSI_RED "%s" ANSI_NORMAL "\n", __func__, __LINE__, buf_); \
|
||||
} while (0)
|
||||
|
||||
#define LIBINPUT_EXPORT __attribute__ ((visibility("default")))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue