[IOT-2634]Color log level 15/22015/4
authorOleksandr Dmytrenko <o.dmytrenko@samsung.com>
Mon, 21 Aug 2017 14:36:48 +0000 (17:36 +0300)
committerOleksandr Dmytrenko <o.dmytrenko@samsung.com>
Tue, 5 Sep 2017 13:57:24 +0000 (16:57 +0300)
Set color debug level by level

Change-Id: Ic7725160106b5bbb626c72c78fbcdaad9a0cb19a
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
resource/csdk/logger/src/logger.c

index c929b47..e7a80d8 100644 (file)
@@ -87,7 +87,7 @@ static oc_log_level LEVEL_XTABLE[] = {OC_LOG_DEBUG, OC_LOG_INFO,
     {ANDROID_LOG_DEBUG, ANDROID_LOG_INFO, ANDROID_LOG_WARN, ANDROID_LOG_ERROR, ANDROID_LOG_FATAL};
 #endif
 #elif defined(__linux__) || defined(__APPLE__) || defined(__msys_nt__)
-    static const char * LEVEL[] __attribute__ ((unused)) = {"DEBUG", "INFO", "WARNING", "ERROR", "FATAL"};
+    static const char * LEVEL[] __attribute__ ((unused)) = {"\e[0;32mDEBUG\033[0m", "\e[0;33mINFO\033[0m", "\e[0;35mWARNING\033[0m", "\e[0;31mERROR\033[0m", "\e[0;31mFATAL\033[0m"};
 #elif defined(_MSC_VER)
     static const char * LEVEL[] = {"DEBUG", "INFO", "WARNING", "ERROR", "FATAL"};
 #elif defined ARDUINO