debug: Allow WAYLAND_DEBUG=server/client for server/client side only debug
authorKristian Høgsberg <krh@bitplanet.net>
Wed, 21 Nov 2012 22:14:55 +0000 (17:14 -0500)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 21 Nov 2012 22:14:55 +0000 (17:14 -0500)
By default the server will dump protocol for both the server and its
clients when run with WAYLAND_DEBUG=1.  That's still the case, but it now
also understands WAYLAND_DEBUG=client or WAYLAND_DEBUG=server, which
will only enable debug dumping on either client or server side.

src/wayland-client.c
src/wayland-server.c

index 5ab000c..4d0637b 100644 (file)
@@ -502,7 +502,7 @@ wl_display_connect_to_fd(int fd)
        const char *debug;
 
        debug = getenv("WAYLAND_DEBUG");
-       if (debug)
+       if (debug && (strstr(debug, "client") || strstr(debug, "1")))
                wl_debug = 1;
 
        display = malloc(sizeof *display);
index acbab9a..f7f4c14 100644 (file)
@@ -1078,7 +1078,7 @@ wl_display_create(void)
        const char *debug;
 
        debug = getenv("WAYLAND_DEBUG");
-       if (debug)
+       if (debug && (strstr(debug, "server") || strstr(debug, "1")))
                wl_debug = 1;
 
        display = malloc(sizeof *display);