[PATCH weston] libinput-seat: literal values for WESTON_LIBINPUT_LOG_PRIORITY

Kristian Høgsberg hoegsberg at gmail.com
Fri May 9 14:26:56 PDT 2014


On Fri, May 09, 2014 at 11:24:40AM -0700, U. Artie Eoff wrote:
> 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 at intel.com>

Thanks Artie, I think we can squeeze that in with the RC2.

Kristian

> ---
>  src/libinput-seat.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libinput-seat.c b/src/libinput-seat.c
> index a38d470..d59ae42 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,
> -- 
> 1.9.0
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list