]> git.sur5r.net Git - i3/i3/blobdiff - src/debug.c
common.mk: Split libstartup-notification flags
[i3/i3] / src / debug.c
index cd89b2967cfd123562f37b1d4424cd33f80d5e86..30822353db2ab69a4e48e801759e12209f4a011c 100644 (file)
@@ -1,19 +1,18 @@
 /*
- * vim:ts=8:expandtab
+ * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
+ * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
  *
- * © 2009 Michael Stapelberg and contributors
- *
- * See file LICENSE for license information.
- *
- * debug.c: Contains debugging functions, especially FormatEvent, which prints unhandled events.
- *          This code is from xcb-util.
+ * debug.c: Debugging functions, especially FormatEvent, which prints unhandled
+ *          events.  This code is from xcb-util.
  *
  */
 #include <stdio.h>
 #include <xcb/xcb.h>
 
+#include "log.h"
+
 static const char *labelError[] = {
     "Success",
     "BadRequest",
@@ -219,7 +218,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 +226,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;
@@ -242,7 +241,3 @@ int format_event(xcb_generic_event_t *e) {
     fflush(stdout);
     return 1;
 }
-
-int handle_event(void *ignored, xcb_connection_t *c, xcb_generic_event_t *e) {
-        return format_event(e);
-}