evdev: reduce the number of separate calls to log_msg

We somewhat expect log message handlers to figure out how to prefix newlines
correctly anyway, but reducing the number of messages printed separately makes
the simple case better.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2017-11-08 11:32:35 +10:00
parent 92aa1d1418
commit 3279845d63

View file

@ -655,17 +655,14 @@ evdev_log_msg_va(struct evdev_device *device,
const char *format,
va_list args)
{
/* Anything info and above is user-visible, use the device name */
log_msg(evdev_libinput_context(device),
priority,
"%-7s - ",
evdev_device_get_sysname(device));
/* Anything info and above is user-visible, use the device name */
if (priority > LIBINPUT_LOG_PRIORITY_DEBUG)
log_msg(evdev_libinput_context(device),
priority,
"%s: ",
device->devname);
"%-7s - %s%s",
evdev_device_get_sysname(device),
(priority > LIBINPUT_LOG_PRIORITY_DEBUG) ? device->devname : "",
(priority > LIBINPUT_LOG_PRIORITY_DEBUG) ? ": " : ""
);
log_msg_va(evdev_libinput_context(device),
priority,