log: check TDM_DLOG in tdm_log_enable_dlog 26/171126/3
authorBoram Park <boram1288.park@samsung.com>
Mon, 26 Feb 2018 23:38:54 +0000 (08:38 +0900)
committerBoram Park <boram1288.park@samsung.com>
Tue, 27 Feb 2018 00:19:12 +0000 (09:19 +0900)
checking it in tdm_log_print is excuted in every log.

Change-Id: I6cc4c132c8cf8188f0bdf702560f3e8e51a5050c

common/tdm_log.c

index 4630770..e2d0277 100644 (file)
@@ -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) {