From 072a508291c884d4c8312accb4e573677cd49cf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 7 Jan 2019 18:31:47 +0100 Subject: [PATCH] module/i3: add more debug logging --- modules/i3.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/i3.c b/modules/i3.c index 6654cda..0f18112 100644 --- a/modules/i3.c +++ b/modules/i3.c @@ -18,6 +18,7 @@ #include #define LOG_MODULE "i3" +#define LOG_ENABLE_DBG 0 #include "../log.h" #include "../bar.h" @@ -313,6 +314,7 @@ handle_workspace_event(struct private *m, const struct json_object *json) struct workspace *w = workspace_lookup( m, json_object_get_string(current_name)); + LOG_DBG("w: %s", w->name); assert(w != NULL); /* Mark all workspaces on current's output invisible */ @@ -436,14 +438,17 @@ run(struct module_run_context *ctx) size_t total_size = sizeof(i3_ipc_header_t) + hdr->size; - if (total_size > buf_idx) + if (total_size > buf_idx) { + LOG_DBG("got %zd bytes, need %zu", bytes, total_size); break; + } /* Json-c expects a NULL-terminated string */ char json_str[hdr->size + 1]; memcpy(json_str, &buf[sizeof(*hdr)], hdr->size); json_str[hdr->size] = '\0'; //printf("raw: %s\n", json_str); + LOG_DBG("raw: %s\n", json_str); json_tokener *tokener = json_tokener_new(); struct json_object *json = json_tokener_parse(json_str);