mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-03-21 23:50:45 +01:00
util: add etrace to trace to stderr
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1116>
This commit is contained in:
parent
3aa004b964
commit
9ac040f72a
1 changed files with 5 additions and 2 deletions
|
|
@ -57,13 +57,16 @@
|
|||
#define DEFAULT_MOUSE_DPI 1000
|
||||
#define DEFAULT_TRACKPOINT_SENSITIVITY 128
|
||||
|
||||
#define trace(...) \
|
||||
#define _trace(file, ...) \
|
||||
do { \
|
||||
char buf_[1024]; \
|
||||
snprintf(buf_, sizeof(buf_), __VA_ARGS__); \
|
||||
printf(ANSI_BLUE "%s():%d - " ANSI_RED "%s" ANSI_NORMAL "\n", __func__, __LINE__, buf_); \
|
||||
fprintf(file, ANSI_BLUE "%s():%d - " ANSI_RED "%s" ANSI_NORMAL "\n", __func__, __LINE__, buf_); \
|
||||
} while (0)
|
||||
|
||||
#define trace(...) _trace(stdout, __VA_ARGS__)
|
||||
#define etrace(...) _trace(stderr, __VA_ARGS__)
|
||||
|
||||
#define LIBINPUT_EXPORT __attribute__ ((visibility("default")))
|
||||
#define LIBINPUT_UNUSED __attribute__ ((unused))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue