discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=6a8cbb53dad28508f0fbb893ce37defbbec11a49

commit 6a8cbb53dad28508f0fbb893ce37defbbec11a49
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Fri Jan 8 11:30:47 2016 -0500

    Revert "e logs - the custom e log func breaks eina backtraces, so don't use 
it"
    
    This reverts commit 2df04042269f3b5604c719844eac372fa5fcddd2.
    
    let's not do this in all cases
---
 src/bin/e_log.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/src/bin/e_log.c b/src/bin/e_log.c
index 7155f2a..6e694db 100644
--- a/src/bin/e_log.c
+++ b/src/bin/e_log.c
@@ -2,10 +2,33 @@
 
 EINTERN int e_log_dom = -1;
 
+static const char *_names[] = {
+   "CRI",
+   "ERR",
+   "WRN",
+   "INF",
+   "DBG",
+};
+
+static void
+_e_log_cb(const Eina_Log_Domain *d, Eina_Log_Level level, const char *file, 
const char *fnc EINA_UNUSED, int line, const char *fmt, void *data EINA_UNUSED, 
va_list args)
+{
+   const char *color;
+
+   color = eina_log_level_color_get(level);
+   fprintf(stdout,
+           "%s%s<" EINA_COLOR_RESET "%s%s>" EINA_COLOR_RESET "%s:%d" 
EINA_COLOR_RESET " ",
+           color, _names[level > EINA_LOG_LEVEL_DBG ? EINA_LOG_LEVEL_DBG : 
level],
+           d->domain_str, color, file, line);
+   vfprintf(stdout, fmt, args);
+   putc('\n', stdout);
+}
+
 EINTERN int
 e_log_init(void)
 {
    e_log_dom = eina_log_domain_register("e", EINA_COLOR_WHITE);
+   eina_log_print_cb_set(_e_log_cb, NULL);
    return e_log_dom != -1;
 }
 

-- 


Reply via email to