summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorU. Artie Eoff <ullysses.a.eoff@intel.com>2014-05-09 11:24:40 -0700
committerKristian Høgsberg <krh@bitplanet.net>2014-05-09 14:26:19 -0700
commit24713f679bc0f7c1930851973a035cfff7b2d274 (patch)
tree8112ba8761252e9bd1da3e4a8ab36cb9ce3d86b0
parent2d13fde9c7a37b78cd685e2f7469e312e14e0262 (diff)
downloadweston-24713f679bc0f7c1930851973a035cfff7b2d274.tar.gz
weston-24713f679bc0f7c1930851973a035cfff7b2d274.tar.bz2
weston-24713f679bc0f7c1930851973a035cfff7b2d274.zip
libinput-seat: literal values for WESTON_LIBINPUT_LOG_PRIORITY
Only accept specific literal values from the environment variable WESTON_LIBINPUT_LOG_PRIORITY... "debug", "info", or "error". Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
-rw-r--r--src/libinput-seat.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libinput-seat.c b/src/libinput-seat.c
index a38d4705..d59ae429 100644
--- a/src/libinput-seat.c
+++ b/src/libinput-seat.c
@@ -271,8 +271,15 @@ udev_input_init(struct udev_input *input, struct weston_compositor *c, struct ud
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));
+ if (strcmp(log_priority, "debug") == 0) {
+ libinput_log_set_priority(LIBINPUT_LOG_PRIORITY_DEBUG);
+ } else if (strcmp(log_priority, "info") == 0) {
+ libinput_log_set_priority(LIBINPUT_LOG_PRIORITY_INFO);
+ } else if (strcmp(log_priority, "error") == 0) {
+ libinput_log_set_priority(LIBINPUT_LOG_PRIORITY_ERROR);
+ }
}
input->libinput = libinput_udev_create_for_seat(&libinput_interface, input,