From: Peter Hutterer Date: Wed, 21 May 2014 04:36:01 +0000 (+1000) Subject: Replace log_bug with per-component bug macros X-Git-Tag: 0.3.0~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=055b1c8bc9b6373f1e40ba33eeeb647c455e0a87;p=platform%2Fupstream%2Flibinput.git Replace log_bug with per-component bug macros 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 Reviewed-by: Hans de Goede --- diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c index 65fa21be..a3220c5b 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 cc54ab37..ed5749e7 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -149,8 +149,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; } @@ -198,8 +198,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 dc1d5905..61cdc79c 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, ...);