return result;
}
-LIBINPUT_ATTRIBUTE_PRINTF(3, 0)
+LIBINPUT_ATTRIBUTE_PRINTF(3, 4)
static inline void
-evdev_log_msg_va(struct evdev_device *device,
- enum libinput_log_priority priority,
- const char *format,
- va_list args)
+evdev_log_msg(struct evdev_device *device,
+ enum libinput_log_priority priority,
+ const char *format,
+ ...)
{
+ va_list args;
char buf[1024];
/* Anything info and above is user-visible, use the device name */
(priority > LIBINPUT_LOG_PRIORITY_DEBUG) ? ": " : "",
format);
- log_msg_va(evdev_libinput_context(device), priority, buf, args);
-}
-
-LIBINPUT_ATTRIBUTE_PRINTF(3, 4)
-static inline void
-evdev_log_msg(struct evdev_device *device,
- enum libinput_log_priority priority,
- const char *format,
- ...)
-{
- va_list args;
-
va_start(args, format);
- evdev_log_msg_va(device, priority, format, args);
+ log_msg_va(evdev_libinput_context(device), priority, buf, args);
va_end(args);
}
...)
{
va_list args;
+ char buf[1024];
+
enum ratelimit_state state;
state = ratelimit_test(ratelimit);
if (state == RATELIMIT_EXCEEDED)
return;
+ /* Anything info and above is user-visible, use the device name */
+ snprintf(buf,
+ sizeof(buf),
+ "%-7s - %s%s%s",
+ evdev_device_get_sysname(device),
+ (priority > LIBINPUT_LOG_PRIORITY_DEBUG) ? device->devname : "",
+ (priority > LIBINPUT_LOG_PRIORITY_DEBUG) ? ": " : "",
+ format);
+
va_start(args, format);
- evdev_log_msg_va(device, priority, format, args);
+ log_msg_va(evdev_libinput_context(device), priority, buf, args);
va_end(args);
if (state == RATELIMIT_THRESHOLD)