mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-04 11:40:30 +01:00
evdev: inline evdev_log_msg_va
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
This commit is contained in:
parent
c9728d8403
commit
d9338b001c
1 changed files with 19 additions and 19 deletions
38
src/evdev.h
38
src/evdev.h
|
|
@ -703,13 +703,14 @@ evdev_hysteresis(const struct device_coords *in,
|
|||
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 */
|
||||
|
|
@ -721,20 +722,8 @@ evdev_log_msg_va(struct evdev_device *device,
|
|||
(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);
|
||||
|
||||
}
|
||||
|
|
@ -748,14 +737,25 @@ evdev_log_msg_ratelimit(struct evdev_device *device,
|
|||
...)
|
||||
{
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue