Add a new log TPL_INFO. 31/249931/1
authorJoonbum Ko <joonbum.ko@samsung.com>
Thu, 17 Dec 2020 10:50:24 +0000 (19:50 +0900)
committerJoonbum Ko <joonbum.ko@samsung.com>
Thu, 17 Dec 2020 10:50:24 +0000 (19:50 +0900)
Change-Id: I549db8c4b447c6bcc3c35fe52a8782e4b470aa9e
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
src/tpl_utils.h

index 26b696e..21f2580 100644 (file)
@@ -73,6 +73,7 @@ inline char *tpl_getenv(const char *name)
 #define FONT_BLUE              "\033[34m"      /* for backend logs */
 #define FONT_MAGENTA   "\033[35m"      /* for debug logs */
 #define FONT_CYAN              "\033[36m"      /* for thread logs */
+#define BG_COLOR_GREEN "\033[0;42m"
 
 #ifdef DLOG_DEFAULT_ENABLE
 #define LOG_TAG "TPL"
@@ -84,6 +85,7 @@ inline char *tpl_getenv(const char *name)
 #define tpl_log_b(t, f, x...)  LOGI(FONT_BLUE t FONT_DEFAULT " " f, ##x)
 #define tpl_log_d(t, f, x...)  LOGI(FONT_MAGENTA t FONT_DEFAULT " " f, ##x)
 #define tpl_log_t(t, f, x...)  LOGI(FONT_CYAN t FONT_DEFAULT " " f, ##x)
+#define tpl_log_i(t, f, x...)  LOGI(BG_COLOR_GREEN t FONT_DEFAULT " " f, ##x)
 #define tpl_log_e(t, f, x...)  LOGE(FONT_RED t " " f FONT_DEFAULT, ##x)
 #define tpl_log_w(t, f, x...)  LOGW(FONT_YELLOW t " " f FONT_DEFAULT, ##x)
 #else /* DLOG_DEFAULT_ENABLE */
@@ -99,6 +101,9 @@ inline char *tpl_getenv(const char *name)
 #define tpl_log_t(t, f, x...)                                                                                  \
        fprintf(stderr, FONT_CYAN t FONT_DEFAULT "[(tid:%li)(%s)]" f "\n",      \
                        syscall(SYS_gettid), __func__, ##x)
+#define tpl_log_i(t, f, x...)                                                                                  \
+       fprintf(stderr, BG_COLOR_GREEN t FONT_DEFAULT "[(tid:%li)(%s)]" f "\n", \
+                       syscall(SYS_gettid), __func__, ##x)
 #define tpl_log_e(t, f, x...)                                                                                  \
        fprintf(stderr, FONT_RED t "[(tid:%li)(%s)] " f FONT_DEFAULT "\n",      \
                        syscall(SYS_gettid), __func__, ##x)
@@ -107,7 +112,7 @@ inline char *tpl_getenv(const char *name)
                        syscall(SYS_gettid), __func__, ##x)
 #endif /* DLOG_DEFAULT_ENABLE */
 
-
+#define TPL_INFO(tag, f, x...) tpl_log_i(tag, f, ##x)
 #define TPL_ERR(f, x...)               tpl_log_e("[TPL_ERROR]", f, ##x)
 #define TPL_WARN(f, x...)              tpl_log_w("[TPL_WARNING]", f, ##x)