[PATCH libinput 4/4] Replace log_bug with per-component bug macros
Peter Hutterer
peter.hutterer at who-t.net
Thu May 22 21:37:16 PDT 2014
When we knowingly hit a bug, we should know what the bug is caused by. Log
that in a standardized fashion.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
src/evdev-mt-touchpad-buttons.c | 8 ++++----
src/evdev.c | 8 ++++----
src/libinput-private.h | 4 +++-
3 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c
index 65fa21b..a3220c5 100644
--- a/src/evdev-mt-touchpad-buttons.c
+++ b/src/evdev-mt-touchpad-buttons.c
@@ -365,8 +365,8 @@ tp_process_button(struct tp_dispatch *tp,
/* Ignore other buttons on clickpads */
if (tp->buttons.is_clickpad && e->code != BTN_LEFT) {
- log_bug("received %s button event on a clickpad (kernel bug?)\n",
- libevdev_event_code_get_name(EV_KEY, e->code));
+ log_bug_kernel("received %s button event on a clickpad\n",
+ libevdev_event_code_get_name(EV_KEY, e->code));
return 0;
}
@@ -416,10 +416,10 @@ tp_init_buttons(struct tp_dispatch *tp,
if (libevdev_has_event_code(device->evdev, EV_KEY, BTN_MIDDLE) ||
libevdev_has_event_code(device->evdev, EV_KEY, BTN_RIGHT)) {
if (tp->buttons.is_clickpad)
- log_bug("clickpad advertising right button (kernel bug?)\n");
+ log_bug_kernel("clickpad advertising right button\n");
} else {
if (!tp->buttons.is_clickpad)
- log_bug("non clickpad without right button (kernel bug)?\n");
+ log_bug_kernel("non clickpad without right button?\n");
}
width = abs(device->abs.max_x - device->abs.min_x);
diff --git a/src/evdev.c b/src/evdev.c
index 08a18fd..6e0bb93 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -137,8 +137,8 @@ evdev_flush_pending_event(struct evdev_device *device, uint64_t time)
break;
if (device->mt.slots[slot].seat_slot != -1) {
- log_bug("%s: Driver sent multiple touch down for the "
- "same slot", device->devnode);
+ log_bug_kernel("%s: Driver sent multiple touch down for the "
+ "same slot", device->devnode);
break;
}
@@ -186,8 +186,8 @@ evdev_flush_pending_event(struct evdev_device *device, uint64_t time)
break;
if (device->abs.seat_slot != -1) {
- log_bug("%s: Driver sent multiple touch down for the "
- "same slot", device->devnode);
+ log_bug_kernel("%s: Driver sent multiple touch down for the "
+ "same slot", device->devnode);
break;
}
diff --git a/src/libinput-private.h b/src/libinput-private.h
index dc1d590..61cdc79 100644
--- a/src/libinput-private.h
+++ b/src/libinput-private.h
@@ -84,7 +84,9 @@ struct libinput_source;
#define log_debug(...) log_msg(LIBINPUT_LOG_PRIORITY_DEBUG, __VA_ARGS__)
#define log_info(...) log_msg(LIBINPUT_LOG_PRIORITY_INFO, __VA_ARGS__)
#define log_error(...) log_msg(LIBINPUT_LOG_PRIORITY_ERROR, __VA_ARGS__)
-#define log_bug(...) log_msg(LIBINPUT_LOG_PRIORITY_ERROR, "BUG: "__VA_ARGS__)
+#define log_bug_kernel(...) log_msg(LIBINPUT_LOG_PRIORITY_ERROR, "kernel bug: " __VA_ARGS__)
+#define log_bug_libinput(...) log_msg(LIBINPUT_LOG_PRIORITY_ERROR, "libinput bug: " __VA_ARGS__);
+#define log_bug_client(...) log_msg(LIBINPUT_LOG_PRIORITY_ERROR, "client bug: " __VA_ARGS__);
void
log_msg(enum libinput_log_priority priority, const char *format, ...);
--
1.9.0
More information about the wayland-devel
mailing list