[mutter/wayland] wayland: Set a log handler



commit 2f14b5cc3f065a7c03c1238f5d09d69e60827b55
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Nov 19 20:04:49 2013 -0500

    wayland: Set a log handler
    
    To see error messages and such

 src/wayland/meta-wayland.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index dabdc1e..061aa0e 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -616,6 +616,15 @@ set_gnome_env (const char *name,
     }
 }
 
+static void
+meta_wayland_log_func (const char *fmt,
+                       va_list     arg)
+{
+  char *str = g_strdup_vprintf (fmt, arg);
+  g_warning ("WL: %s", str);
+  g_free (str);
+}
+
 void
 meta_wayland_init (void)
 {
@@ -633,6 +642,7 @@ meta_wayland_init (void)
     g_error ("failed to create wayland display");
 
   wl_display_init_shm (compositor->wayland_display);
+  wl_log_set_handler_server(meta_wayland_log_func);
 
   wl_list_init (&compositor->frame_callbacks);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]