# Platform logging. Whether logging happens at all.
plog=1
+# Debugmode - whether write platform debug log or not
+debugmode=1
+
# Limiter - whether it's enabled and the rules (check the documentation for how to create rules).
limiter=0
limiter|*|*=allow
AC_PROG_GCC_TRADITIONAL
AC_PROG_LIBTOOL
-# check binary type for dlog debug mode
-AC_ARG_ENABLE([debug_mode],
- AS_HELP_STRING([--enable-debug_mode Turn on debug_mode]),
- [debug_mode=yes],
- debug_mode=no)
-if test "x$debug_mode" = "xyes" ; then
- DEBUG_CFLAGS+=" -DDLOG_DEBUG_ENABLE"
-fi
-AC_ARG_ENABLE([debug_enable],
- AS_HELP_STRING([--enable-debug_enable Turn on debug_enable]),
- [debug_enable=yes],
- debug_enable=no)
AC_SUBST(DEBUG_CFLAGS)
# Checks for libraries.
# Checks for header files.
cp %{SOURCE104} .
%autogen --disable-static
%configure --disable-static \
- --enable-debug_mode \
TZ_SYS_ETC=%{TZ_SYS_ETC}
make %{?jobs:-j%jobs} \
CFLAGS+=-DTZ_SYS_ETC=\\\"%{TZ_SYS_ETC}\\\"
static int limiter;
static int plog;
static int debugmode;
+static int fatal_assert;
/**
* @brief Null handler
else if (!strncmp(conf_value, "logger", sizeof("logger") + 1))
__dlog_init_android();
+ fatal_assert = access(DEBUGMODE_FILE, F_OK);
+ conf_value = log_config_get(&conf, "debugmode");
+ debugmode = atoi(conf_value);
+
log_config_free(&conf);
return;
__configure();
is_initialized = 1;
}
- debugmode = access(DEBUGMODE_FILE, F_OK) != -1 ? 1 : 0;
+
pthread_mutex_unlock(&log_init_lock);
}
*/
void __dlog_fatal_assert(int prio)
{
- assert(debugmode || !(prio == DLOG_FATAL));
+ assert(!fatal_assert || (prio != DLOG_FATAL));
}
/**
*/
static int dlog_should_log(log_id_t log_id, const char* tag, int prio)
{
-
-#ifndef DLOG_DEBUG_ENABLE
- if (prio <= DLOG_DEBUG)
+ if (!debugmode && prio <= DLOG_DEBUG)
return DLOG_ERROR_INVALID_PARAMETER;
-#endif
+
if (!tag)
return DLOG_ERROR_INVALID_PARAMETER;