[PATCH 1/3] Make default log handler print to stderr

Pekka Paalanen ppaalanen at gmail.com
Sat Feb 8 01:44:11 PST 2014


On Fri,  7 Feb 2014 22:27:00 -0800
Kristian Høgsberg <krh at bitplanet.net> wrote:

> On the client side we log fatal errors before we exit.  If a
> client doesn't set a log handler, it's hard to figure out what
> goes wrong. ---
>  src/wayland-util.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/wayland-util.c b/src/wayland-util.c
> index 4fe9c81..b099882 100644
> --- a/src/wayland-util.c
> +++ b/src/wayland-util.c
> @@ -23,6 +23,7 @@
>  
>  #include <stdlib.h>
>  #include <stdint.h>
> +#include <stdio.h>
>  #include <string.h>
>  #include <stdarg.h>
>  
> @@ -361,11 +362,12 @@ wl_map_for_each(struct wl_map *map,
> wl_iterator_func_t func, void *data) }
>  
>  static void
> -wl_log_noop_handler(const char *fmt, va_list arg)
> +wl_log_stderr_handler(const char *fmt, va_list arg)
>  {
> +	vfprintf(stderr, fmt, arg);
>  }
>  
> -wl_log_func_t wl_log_handler = wl_log_noop_handler;
> +wl_log_func_t wl_log_handler = wl_log_stderr_handler;
>  
>  void
>  wl_log(const char *fmt, ...)
> -- 

Hi,

seems you think it is fine to printf() from libwayland-client *and*
libwayland-server by default, so ok by me then. You probably know
library conventions better than I do.


Thanks,
pq


More information about the wayland-devel mailing list