[PATCH weston 3/4] tests: set client log handler

Pekka Paalanen ppaalanen at gmail.com
Wed Dec 12 04:26:40 PST 2012


Otherwise we cannot normally see protocol errors etc. in the test
output.

Signed-off-by: Pekka Paalanen <ppaalanen at gmail.com>
---
 tests/weston-test-client-helper.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/tests/weston-test-client-helper.c b/tests/weston-test-client-helper.c
index c7ab4e5..1a1b4f1 100644
--- a/tests/weston-test-client-helper.c
+++ b/tests/weston-test-client-helper.c
@@ -442,12 +442,21 @@ static const struct wl_registry_listener registry_listener = {
 	handle_global
 };
 
+static void
+log_handler(const char *fmt, va_list args)
+{
+	fprintf(stderr, "libwayland: ");
+	vfprintf(stderr, fmt, args);
+}
+
 struct client *
 client_create(int x, int y, int width, int height)
 {
 	struct client *client;
 	struct surface *surface;
 
+	wl_log_set_handler_client(log_handler);
+
 	/* connect to display */
 	client = calloc(1, sizeof *client);
 	client->wl_display = wl_display_connect(NULL);
-- 
1.7.8.6



More information about the wayland-devel mailing list