Set default debug level to error 4.99.3 5.99.1 5.99.2 eel/4.99.3 eel_4.99.3 flounder/5.99.1 flounder/5.99.2 flounder_5.99.1 flounder_5.99.2
authorzheng_wenlong <wenlong_zheng@nexty-ele.com>
Thu, 9 Nov 2017 03:58:41 +0000 (12:58 +0900)
committerZheng Wenlong <wenlong_zheng@nexty-ele.com>
Fri, 10 Nov 2017 00:15:03 +0000 (00:15 +0000)
    Default enable HMI_ERROR output.
    Remove afb-binding.h and add necessary header files.

    [Patch Set 2]
    Change LOG_LEVEL_MAX value equal LOG_LEVEL_DEBUG.

Change-Id: Ie50e267b9ff9ad107bb38162ad90acc410c79cbc
Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
src/hmi-debug.h

index 3240171..2a744ba 100644 (file)
@@ -19,8 +19,9 @@
 
 #include <time.h>
 #include <stdio.h>
+#include <stdarg.h>
 #include <string.h>
-#include <afb/afb-binding.h>
+#include <stdlib.h>
 
 enum LOG_LEVEL{
     LOG_LEVEL_NONE = 0,
@@ -29,7 +30,7 @@ enum LOG_LEVEL{
     LOG_LEVEL_NOTICE,
     LOG_LEVEL_INFO,
     LOG_LEVEL_DEBUG,
-    LOG_LEVEL_MAX = LOG_LEVEL_ERROR
+    LOG_LEVEL_MAX = LOG_LEVEL_DEBUG
 };
 
 #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
@@ -44,7 +45,7 @@ static char ERROR_FLAG[6][20] = {"NONE", "ERROR", "WARNING", "NOTICE", "INFO", "
 
 static void _HMI_LOG(enum LOG_LEVEL level, const char* file, const char* func, const int line, const char* prefix, const char* log, ...)
 {
-    const int log_level = (getenv("USE_HMI_DEBUG") == NULL)?0:atoi(getenv("USE_HMI_DEBUG"));
+    const int log_level = (getenv("USE_HMI_DEBUG") == NULL)?LOG_LEVEL_ERROR:atoi(getenv("USE_HMI_DEBUG"));
     if(log_level < level)
     {
         return;