jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1f75cfc3cfea087433b10df14fdfc355ae84fc4a

commit 1f75cfc3cfea087433b10df14fdfc355ae84fc4a
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Tue Dec 15 15:27:20 2015 +0900

    Eina log: Disable backtrace by default for dev builds
    
    The EINA_LOG_BACKTRACE thing is aimed at production environments,
    so we can extract a backtrace from a log file post-mortem, but not
    for continuous development of EFL itself.
    
    I know this should make a few people happy.
---
 configure.ac            | 5 +++++
 src/lib/eina/eina_log.c | 7 ++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 05b836c..08976a5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,12 +85,17 @@ case "${build_profile}" in
 esac
 
 prefer_assert="no"
+eina_log_backtrace="yes"
 case "${build_profile}" in
    dev|debug)
      prefer_assert="yes"
+     eina_log_backtrace="no"
      ;;
 esac
 
+# Enable CRI & ERR backtrace by default for release but not for dev/debug
+AC_DEFINE_IF([EINA_LOG_BACKTRACE_ENABLE], [test "x${eina_log_backtrace}" = 
"xyes"], [1], [Default log level triggering backtraces])
+
 # TODO: add some build "profile" (server, full, etc...)
 
 AC_ARG_WITH([crypto],
diff --git a/src/lib/eina/eina_log.c b/src/lib/eina/eina_log.c
index 3d30d34..b544468 100644
--- a/src/lib/eina/eina_log.c
+++ b/src/lib/eina/eina_log.c
@@ -121,7 +121,12 @@ static Eina_Bool _disable_timing = EINA_TRUE;
 static int _abort_level_on_critical = EINA_LOG_LEVEL_CRITICAL;
 
 #ifdef EINA_LOG_BACKTRACE
-static int _backtrace_level = 1; // CRI & ERR by default
+// CRI & ERR by default in release mode, nothing in dev mode
+# ifndef EINA_LOG_BACKTRACE_ENABLE
+static int _backtrace_level = -1;
+# else
+static int _backtrace_level = 1;
+# endif
 #endif
 
 static Eina_Bool _threads_enabled = EINA_FALSE;

-- 


Reply via email to