64
* Internal only: log data used to send messages to the respective log
65
* handler. We re-use the same struct for a global and inside
67
* For the global, device_handler is NULL, for per-device instance
68
* global_handler is NULL.
71
enum libevdev_log_priority priority; /** minimum logging priority */
72
libevdev_log_func_t global_handler; /** global handler function */
73
libevdev_device_log_func_t device_handler; /** per-device handler function */
74
void *userdata; /** user-defined data pointer */
106
120
unsigned long *tracking_id_changes;
107
121
size_t tracking_id_changes_sz; /* in bytes */
112
enum libevdev_log_priority priority; /** minimum logging priority */
113
libevdev_log_func_t handler; /** handler function */
114
void *userdata; /** user-defined data pointer */
116
extern struct logdata log_data;
118
#define log_msg_cond(priority, ...) \
127
#define log_msg_cond(dev, priority, ...) \
120
if (libevdev_get_log_priority() >= priority) \
121
log_msg(priority, log_data.userdata, __FILE__, __LINE__, __func__, __VA_ARGS__); \
129
if (_libevdev_log_priority(dev) >= priority) \
130
_libevdev_log_msg(dev, priority, __FILE__, __LINE__, __func__, __VA_ARGS__); \
124
#define log_error(...) log_msg_cond(LIBEVDEV_LOG_ERROR, __VA_ARGS__)
125
#define log_info(...) log_msg_cond(LIBEVDEV_LOG_INFO, __VA_ARGS__)
126
#define log_dbg(...) log_msg_cond(LIBEVDEV_LOG_DEBUG, __VA_ARGS__)
127
#define log_bug(...) log_msg_cond(LIBEVDEV_LOG_ERROR, "BUG: "__VA_ARGS__)
133
#define log_error(dev, ...) log_msg_cond(dev, LIBEVDEV_LOG_ERROR, __VA_ARGS__)
134
#define log_info(dev, ...) log_msg_cond(dev, LIBEVDEV_LOG_INFO, __VA_ARGS__)
135
#define log_dbg(dev, ...) log_msg_cond(dev, LIBEVDEV_LOG_DEBUG, __VA_ARGS__)
136
#define log_bug(dev, ...) log_msg_cond(dev, LIBEVDEV_LOG_ERROR, "BUG: "__VA_ARGS__)
130
log_msg(enum libevdev_log_priority priority,
132
const char *file, int line, const char *func,
133
const char *format, ...) LIBEVDEV_ATTRIBUTE_PRINTF(6, 7);
139
_libevdev_log_msg(const struct libevdev *dev,
140
enum libevdev_log_priority priority,
141
const char *file, int line, const char *func,
142
const char *format, ...) LIBEVDEV_ATTRIBUTE_PRINTF(6, 7);
143
extern enum libevdev_log_priority
144
_libevdev_log_priority(const struct libevdev *dev);
136
147
* @return a pointer to the next element in the queue, or NULL if the queue