From 6d4a332ae2fc901edbec798972a9d18f321b8783 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Tue, 27 Feb 2018 08:38:54 +0900 Subject: [PATCH] log: check TDM_DLOG in tdm_log_enable_dlog checking it in tdm_log_print is excuted in every log. Change-Id: I6cc4c132c8cf8188f0bdf702560f3e8e51a5050c --- common/tdm_log.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/common/tdm_log.c b/common/tdm_log.c index 4630770..e2d0277 100644 --- a/common/tdm_log.c +++ b/common/tdm_log.c @@ -59,7 +59,7 @@ #undef LOG_TAG #define LOG_TAG "TDM" -static unsigned int dlog_enable = 1; +static unsigned int dlog_enable = 0; static unsigned int color_enable = 1; static unsigned int assert_level = TDM_LOG_LEVEL_NONE; @@ -80,6 +80,10 @@ tdm_log_enable_color(unsigned int enable) EXTERN void tdm_log_enable_dlog(unsigned int enable) { + const char *debug = getenv("TDM_DLOG"); + if (debug && strstr(debug, "1")) + enable = 1; + dlog_enable = enable; } @@ -161,9 +165,6 @@ tdm_log_print(int level, const char *fmt, ...) if (level > tdm_log_debug_level) return; - if (getenv("TDM_DEBUG")) - dlog_enable = 0; - if (dlog_enable) { log_priority dlog_prio; switch (level) { -- 2.7.4