log: remove unused code 91/171291/2
authorBoram Park <boram1288.park@samsung.com>
Wed, 28 Feb 2018 05:47:01 +0000 (14:47 +0900)
committerBoram Park <boram1288.park@samsung.com>
Wed, 7 Mar 2018 01:35:48 +0000 (10:35 +0900)
Change-Id: Id0683906617148ed05423561c3bf5987ad592f37

common/tdm_log.c
include/tdm_log.h
utests/src/ut_tdm_log.cpp

index 3f6b56066891a6919f4ce61414c6666cdb5377c3..aa3d1820a6201c5b6585de4cdab1a0bf754c2128 100644 (file)
@@ -86,24 +86,21 @@ tdm_log_enable_dlog(unsigned int enable)
        dlog_enable = enable;
 }
 
-EXTERN void
-tdm_log_enable_debug(unsigned int enable)
-{
-       if (enable)
-               tdm_log_debug_level = TDM_LOG_LEVEL_DBG;
-       else
-               tdm_log_debug_level = TDM_LOG_LEVEL_INFO;
-}
-
 EXTERN void
 tdm_log_set_debug_level(int level)
 {
+       const char *str = getenv("TDM_DEBUG_LEVEL");
+       if (str)
+               level = str[0] - '0';
        tdm_log_debug_level = level;
 }
 
 EXTERN void
 tdm_log_set_assert_level(int level)
 {
+       const char *str = getenv("TDM_ASSERT_LEVEL");
+       if (str)
+               level = str[0] - '0';
        assert_level = level;
 }
 
index b653aa2228c12437021abe19ebefb85b6ce907ac..5a9fb652e27cebf9c98e5e10f99cba8e56b10298 100644 (file)
@@ -66,7 +66,6 @@ enum {
 
 void tdm_log_enable_color(unsigned int enable);
 void tdm_log_enable_dlog(unsigned int enable);
-void tdm_log_enable_debug(unsigned int enable);
 void tdm_log_set_debug_level(int level);
 void tdm_log_set_assert_level(int level);
 void tdm_log_set_path(const char *path);
index 2d4e24561915b7da3513e42db176d16cd8bb745a..64f6154eae9537320a3695182ffdcfc7261637e4 100644 (file)
@@ -36,7 +36,6 @@ TEST(TDMLog, logPrintf)
 {
        tdm_log_enable_color(1);
        tdm_log_enable_dlog(0);
-       tdm_log_enable_debug(1);
        tdm_log_set_debug_level(2);
        tdm_log_set_path("/tmp/tdm.log");
        tdm_log_print(TDM_LOG_LEVEL_ERR, "utest\n");
@@ -58,7 +57,6 @@ TEST(TDMLog, logDlogNone)
 {
        tdm_log_enable_color(0);
        tdm_log_enable_dlog(1);
-       tdm_log_enable_debug(0);
        tdm_log_set_debug_level(0);
        tdm_log_print(TDM_LOG_LEVEL_ERR, "utest");
        tdm_log_print(TDM_LOG_LEVEL_WRN, "utest");
@@ -69,7 +67,6 @@ TEST(TDMLog, logDlogNone)
 TEST(TDMLog, logDlog)
 {
        tdm_log_enable_dlog(1);
-       tdm_log_enable_debug(1);
        tdm_log_print(TDM_LOG_LEVEL_ERR, "utest");
        tdm_log_print(TDM_LOG_LEVEL_WRN, "utest");
        tdm_log_print(TDM_LOG_LEVEL_INFO, "utest");
@@ -79,7 +76,6 @@ TEST(TDMLog, logDlog)
 TEST(TDMLog, logDlogNormal)
 {
        tdm_log_enable_dlog(1);
-       tdm_log_enable_debug(0);
        tdm_log_print(TDM_LOG_LEVEL_ERR, "utest");
        tdm_log_print(TDM_LOG_LEVEL_WRN, "utest");
        tdm_log_print(TDM_LOG_LEVEL_INFO, "utest");