summaryrefslogtreecommitdiff
path: root/legacy/edje/src/bin/edje_cc_mem.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2012-07-31 22:42:03 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-07-31 22:42:03 +0000
commitf1e077844e58fd00a0f1dec43aae459890db2f14 (patch)
tree25120defdda32a0686c1ef60bceb33c5d29cd958 /legacy/edje/src/bin/edje_cc_mem.c
parentbb4344642179302e7d712eb8550292a2bfb5efa4 (diff)
fix edje error reporting for once and for all.
edje error was a mess. First someone (maybe myself) added eina log, then people changed it to be a mix with printf()... then they replaced eina_log with printf() + colors so it would be less verbose. It's fixed now! Using eina log infrastructure. If all that is wanted is specific messages for edje_cc domain, do it with a specific log print function (eina_log_print_cb_set()). I made it produce messages in the format: <levelcolor><progname>: <levelprefix><message> Where: - levelcolor is defined by eina_log (I hacked the win32 version, since no public api to resolve level to color). - levelprefix is "Error. " or "Warning. " to cope with traditional output. If it does not look as you wanted, let me know before stuffing some printf() again. Bonus point: reduced 2 global variables (progname and verbose), removed lots of code. SVN revision: 74701
Diffstat (limited to 'legacy/edje/src/bin/edje_cc_mem.c')
-rw-r--r--legacy/edje/src/bin/edje_cc_mem.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/legacy/edje/src/bin/edje_cc_mem.c b/legacy/edje/src/bin/edje_cc_mem.c
index d2d4ae04cc..e1fa23953a 100644
--- a/legacy/edje/src/bin/edje_cc_mem.c
+++ b/legacy/edje/src/bin/edje_cc_mem.c
@@ -14,8 +14,8 @@ mem_alloc(size_t size)
14 14
15 mem = calloc(1, size); 15 mem = calloc(1, size);
16 if (mem) return mem; 16 if (mem) return mem;
17 ERR("%s: Error. %s:%i memory allocation of %zu bytes failed. %s", 17 ERR("%s:%i memory allocation of %zu bytes failed. %s",
18 progname, file_in, line, size, strerror(errno)); 18 file_in, line, size, strerror(errno));
19 exit(-1); 19 exit(-1);
20 return NULL; 20 return NULL;
21} 21}
@@ -27,8 +27,8 @@ mem_strdup(const char *s)
27 27
28 str = strdup(s); 28 str = strdup(s);
29 if (str) return str; 29 if (str) return str;
30 ERR("%s: Error. %s:%i memory allocation of %zu bytes failed. %s. string being duplicated: \"%s\"", 30 ERR("%s:%i memory allocation of %zu bytes failed. %s. string being duplicated: \"%s\"",
31 progname, file_in, line, strlen(s) + 1, strerror(errno), s); 31 file_in, line, strlen(s) + 1, strerror(errno), s);
32 exit(-1); 32 exit(-1);
33 return NULL; 33 return NULL;
34} 34}