From: Michael Stapelberg Date: Sun, 8 Jun 2014 19:56:14 +0000 (+0200) Subject: replace remaining printf()s with D?LOG X-Git-Tag: 4.8~24 X-Git-Url: https://git.sur5r.net/?p=i3%2Fi3;a=commitdiff_plain;h=617afc67a25c9bb7bf91a7659319e07fbe32d758 replace remaining printf()s with D?LOG fixes #1252 --- diff --git a/src/commands.c b/src/commands.c index 73dba4fa..801c9306 100644 --- a/src/commands.c +++ b/src/commands.c @@ -359,7 +359,7 @@ void cmd_criteria_add(I3_CMD, char *ctype, char *cvalue) { ELOG("Could not parse con id \"%s\"\n", cvalue); } else { current_match->con_id = (Con*)parsed; - printf("id as int = %p\n", current_match->con_id); + DLOG("id as int = %p\n", current_match->con_id); } return; } @@ -374,7 +374,7 @@ void cmd_criteria_add(I3_CMD, char *ctype, char *cvalue) { ELOG("Could not parse window id \"%s\"\n", cvalue); } else { current_match->id = parsed; - printf("window id as int = %d\n", current_match->id); + DLOG("window id as int = %d\n", current_match->id); } return; } diff --git a/src/config_directives.c b/src/config_directives.c index a5f891bf..a43e171b 100644 --- a/src/config_directives.c +++ b/src/config_directives.c @@ -69,7 +69,7 @@ CFGFUN(criteria_add, const char *ctype, const char *cvalue) { ELOG("Could not parse con id \"%s\"\n", cvalue); } else { current_match->con_id = (Con*)parsed; - printf("id as int = %p\n", current_match->con_id); + DLOG("id as int = %p\n", current_match->con_id); } return; } @@ -84,7 +84,7 @@ CFGFUN(criteria_add, const char *ctype, const char *cvalue) { ELOG("Could not parse window id \"%s\"\n", cvalue); } else { current_match->id = parsed; - printf("window id as int = %d\n", current_match->id); + DLOG("window id as int = %d\n", current_match->id); } return; } diff --git a/src/config_parser.c b/src/config_parser.c index ede27599..a5e69264 100644 --- a/src/config_parser.c +++ b/src/config_parser.c @@ -687,7 +687,7 @@ static int detect_version(char *buf) { strncasecmp(line, "force_focus_wrapping", strlen("force_focus_wrapping")) == 0 || strncasecmp(line, "# i3 config file (v4)", strlen("# i3 config file (v4)")) == 0 || strncasecmp(line, "workspace_layout", strlen("workspace_layout")) == 0) { - printf("deciding for version 4 due to this line: %.*s\n", (int)(walk-line), line); + LOG("deciding for version 4 due to this line: %.*s\n", (int)(walk-line), line); return 4; } @@ -719,7 +719,7 @@ static int detect_version(char *buf) { strncasecmp(bind, "border borderless", strlen("border borderless")) == 0 || strncasecmp(bind, "--no-startup-id", strlen("--no-startup-id")) == 0 || strncasecmp(bind, "bar", strlen("bar")) == 0) { - printf("deciding for version 4 due to this line: %.*s\n", (int)(walk-line), line); + LOG("deciding for version 4 due to this line: %.*s\n", (int)(walk-line), line); return 4; } } @@ -987,12 +987,12 @@ void parse_file(const char *f) { free(new); new = converted; } else { - printf("\n"); - printf("**********************************************************************\n"); - printf("ERROR: Could not convert config file. Maybe i3-migrate-config-to-v4\n"); - printf("was not correctly installed on your system?\n"); - printf("**********************************************************************\n"); - printf("\n"); + LOG("\n"); + LOG("**********************************************************************\n"); + LOG("ERROR: Could not convert config file. Maybe i3-migrate-config-to-v4\n"); + LOG("was not correctly installed on your system?\n"); + LOG("**********************************************************************\n"); + LOG("\n"); } } diff --git a/src/tree.c b/src/tree.c index d4936299..9c8f5602 100644 --- a/src/tree.c +++ b/src/tree.c @@ -86,13 +86,13 @@ bool tree_restore(const char *path, xcb_get_geometry_reply_t *geometry) { tree_append_json(focused, globbed, NULL); - printf("appended tree, using new root\n"); + DLOG("appended tree, using new root\n"); croot = TAILQ_FIRST(&(croot->nodes_head)); - printf("new root = %p\n", croot); + DLOG("new root = %p\n", croot); Con *out = TAILQ_FIRST(&(croot->nodes_head)); - printf("out = %p\n", out); + DLOG("out = %p\n", out); Con *ws = TAILQ_FIRST(&(out->nodes_head)); - printf("ws = %p\n", ws); + DLOG("ws = %p\n", ws); /* For in-place restarting into v4.2, we need to make sure the new * pseudo-output __i3 is present. */ diff --git a/src/util.c b/src/util.c index 5db30c9d..83a2d57b 100644 --- a/src/util.c +++ b/src/util.c @@ -260,7 +260,7 @@ char *store_restart_layout(void) { return NULL; } if (n == 0) { - printf("write == 0?\n"); + DLOG("write == 0?\n"); free(filename); close(fd); return NULL; @@ -271,7 +271,7 @@ char *store_restart_layout(void) { close(fd); if (length > 0) { - printf("layout: %.*s\n", (int)length, payload); + DLOG("layout: %.*s\n", (int)length, payload); } y(free);