#define MSAPI_DBG_STRERROR(fmt) do { \
char buf[BUF_LENGTH] = {0,}; \
- LOGE(fmt" : STANDARD ERROR [%s]", strerror_r(errno, buf, BUF_LENGTH)); \
+ LOGE(FONT_COLOR_RED""fmt""" : STANDARD ERROR [%s]"FONT_COLOR_RESET, strerror_r(errno, buf, BUF_LENGTH)); \
} while (0)
-#define MSAPI_DBG_SLOG(fmt, args...) do { \
- SECURE_LOGD(fmt "\n", ##args); \
+#define MSAPI_DBG_SLOG(fmt, arg...) do { \
+ SECURE_LOGD(FONT_COLOR_CYAN""fmt""FONT_COLOR_RESET, ##arg); \
} while (0)
#define MSAPI_DBG(fmt, arg...) do { \
- LOGD(FONT_COLOR_RESET fmt, ##arg); \
+ LOGD(FONT_COLOR_RESET""fmt"", ##arg); \
} while (0)
#define MSAPI_DBG_INFO(fmt, arg...) do { \
- LOGI(FONT_COLOR_GREEN fmt, ##arg); \
+ LOGI(FONT_COLOR_GREEN""fmt""FONT_COLOR_RESET, ##arg); \
} while (0)
#define MSAPI_DBG_ERR(fmt, arg...) do { \
- LOGE(FONT_COLOR_RED fmt, ##arg); \
+ LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \
} while (0)
#define MSAPI_DBG_FUNC() do { \
#define MSAPI_RETV_IF(expr, val) do { \
if (expr) { \
- LOGE(FONT_COLOR_RED); \
+ LOGE(FONT_COLOR_RED""FONT_COLOR_RESET); \
return (val); \
} \
} while (0)
#define MSAPI_RETVM_IF(expr, val, fmt, arg...) do { \
if (expr) { \
- LOGE(FONT_COLOR_RED fmt, ##arg); \
+ LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \
return (val); \
} \
} while (0)
#define LOG_TAG "MEDIA_COMMON"
#define BUF_LENGTH 256
+#define FONT_COLOR_RESET "\033[0m"
+#define FONT_COLOR_RED "\033[31m"
+#define FONT_COLOR_GREEN "\033[32m"
+#define FONT_COLOR_YELLOW "\033[33m"
+#define FONT_COLOR_BLUE "\033[34m"
+#define FONT_COLOR_PURPLE "\033[35m"
+#define FONT_COLOR_CYAN "\033[36m"
+#define FONT_COLOR_GRAY "\033[37m"
+
#define MS_DBG_STRERROR(fmt) do { \
char buf[BUF_LENGTH] = {0,}; \
- LOGE(fmt" : STANDARD ERROR [%s]", strerror_r(errno, buf, BUF_LENGTH)); \
+ LOGE(FONT_COLOR_RED""fmt""" : STANDARD ERROR [%s]"FONT_COLOR_RESET, strerror_r(errno, buf, BUF_LENGTH)); \
} while (0)
-#define MS_DBG_SLOG(fmt, args...) do { if (true) { \
- SECURE_LOGD(fmt "\n" , ##args); \
+#define MS_DBG_SLOG(fmt, arg...) do { if (true) { \
+ SECURE_LOGD(FONT_COLOR_CYAN""fmt""FONT_COLOR_RESET, ##arg); \
} } while (false)
-#define MS_DBG(fmt, args...) do { if (true) { \
- LOGD(fmt "\n" , ##args); \
+#define MS_DBG(fmt, arg...) do { if (true) { \
+ LOGD(FONT_COLOR_RESET""fmt"", ##arg); \
} } while (false)
-#define MS_DBG_INFO(fmt, args...) do { if (true) { \
- LOGI(fmt "\n" , ##args); \
+#define MS_DBG_INFO(fmt, arg...) do { if (true) { \
+ LOGI(FONT_COLOR_GREEN""fmt""FONT_COLOR_RESET, ##arg); \
} } while (false)
-#define MS_DBG_WARN(fmt, args...) do { if (true) { \
- LOGW(fmt "\n", ##args); \
+#define MS_DBG_WARN(fmt, arg...) do { if (true) { \
+ LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \
} } while (false)
-#define MS_DBG_ERR(fmt, args...) do { if (true) { \
- LOGE(fmt "\n", ##args); \
+#define MS_DBG_ERR(fmt, arg...) do { if (true) { \
+ LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \
} } while (false)
#define MS_DBG_FENTER() do { if (true) { \
- LOGD("<ENTER> \n"); \
+ LOGD(FONT_COLOR_YELLOW"<ENTER>"FONT_COLOR_RESET); \
} } while (false)
#define MS_DBG_FLEAVE() do { if (true) { \
- LOGD("<LEAVE> \n"); \
+ LOGD(FONT_COLOR_YELLOW"<LEAVE>"FONT_COLOR_RESET); \
} } while (false)
#endif /*_MEDIA_COMMON_DBG_H_*/