diff options
author | U. Artie Eoff <ullysses.a.eoff@intel.com> | 2014-04-17 07:53:23 -0700 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2014-04-21 14:35:33 -0700 |
commit | c81c4241d9c9fc5f60c08177dd8a33ae4e4ddca1 (patch) | |
tree | 1a4beff9b76afc6cc73e8f742661960f2b23fd3b /src/libinput-seat.c | |
parent | 71db0fd117a8585ee083c8b565bb9afdfa159a6a (diff) | |
download | weston-c81c4241d9c9fc5f60c08177dd8a33ae4e4ddca1.tar.gz |
libinput-seat: allow setting libinput log priority in weston
Look for WESTON_LIBINPUT_LOG_PRIORITY environment variable. If
it exists then use it to set the libinput log priority.
Otherwise, don't set the priority and get whatever libinput's
default priority is.
Setting WESTON_LIBINPUT_LOG_PRIORITY=0 allows us to log which
input devices are detected at Weston startup and makes it a
little more consistent with Weston's original evdev input setup
log messages... and useful for debugging and testing.
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Diffstat (limited to 'src/libinput-seat.c')
-rw-r--r-- | src/libinput-seat.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libinput-seat.c b/src/libinput-seat.c index 99612c46..7aca969f 100644 --- a/src/libinput-seat.c +++ b/src/libinput-seat.c @@ -262,12 +262,19 @@ int udev_input_init(struct udev_input *input, struct weston_compositor *c, struct udev *udev, const char *seat_id) { + const char *log_priority = NULL; + memset(input, 0, sizeof *input); input->compositor = c; libinput_log_set_handler(&libinput_log_func, NULL); + log_priority = getenv("WESTON_LIBINPUT_LOG_PRIORITY"); + if (log_priority) { + libinput_log_set_priority(strtol(log_priority, NULL, 10)); + } + input->libinput = libinput_udev_create_for_seat(&libinput_interface, input, udev, seat_id); if (!input->libinput) { |