From: Michael Stapelberg Date: Fri, 19 Mar 2010 17:48:36 +0000 (+0100) Subject: Use DLOG for debug messages instead of printf (Thanks kruM) X-Git-Tag: 3.e~6^2~55 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=af00df9321927bfc587140fbdaac0da61341ccc6;p=i3%2Fi3 Use DLOG for debug messages instead of printf (Thanks kruM) --- diff --git a/include/log.h b/include/log.h index def99fc1..6d529a00 100644 --- a/include/log.h +++ b/include/log.h @@ -3,7 +3,7 @@ * * i3 - an improved dynamic tiling window manager * - * © 2009 Michael Stapelberg and contributors + * © 2009-2010 Michael Stapelberg and contributors * * See file LICENSE for license information. * @@ -12,6 +12,7 @@ #define _LOG_H #include +#include /** ##__VA_ARGS__ means: leave out __VA_ARGS__ completely if it is empty, that is, delete the preceding comma */ diff --git a/src/debug.c b/src/debug.c index cd89b296..de47fca2 100644 --- a/src/debug.c +++ b/src/debug.c @@ -3,7 +3,7 @@ * * i3 - an improved dynamic tiling window manager * - * © 2009 Michael Stapelberg and contributors + * © 2009-2010 Michael Stapelberg and contributors * * See file LICENSE for license information. * @@ -14,6 +14,8 @@ #include #include +#include "log.h" + static const char *labelError[] = { "Success", "BadRequest", @@ -219,7 +221,7 @@ int format_event(xcb_generic_event_t *e) { switch(e->response_type) { case 0: - printf("Error %s on seqnum %d (%s).\n", + DLOG("Error %s on seqnum %d (%s).\n", labelError[*((uint8_t *) e + 1)], seqnum, labelRequest[*((uint8_t *) e + 10)]); @@ -227,13 +229,13 @@ int format_event(xcb_generic_event_t *e) { default: if (e->response_type > sizeof(labelEvent) / sizeof(char*)) break; - printf("Event %s following seqnum %d%s.\n", + DLOG("Event %s following seqnum %d%s.\n", labelEvent[e->response_type], seqnum, labelSendEvent[sendEvent]); break; case XCB_KEYMAP_NOTIFY: - printf("Event %s%s.\n", + DLOG("Event %s%s.\n", labelEvent[e->response_type], labelSendEvent[sendEvent]); break;