14 #define LOG_TAG "devmode"
15 #define TSP_DEBUG_MODE 1
17 /* anci c color type */
18 #define FONT_COLOR_RESET "\033[0m"
19 #define FONT_COLOR_RED "\033[31m"
20 #define FONT_COLOR_GREEN "\033[32m"
21 #define FONT_COLOR_YELLOW "\033[33m"
22 #define FONT_COLOR_BLUE "\033[34m"
23 #define FONT_COLOR_PURPLE "\033[35m"
24 #define FONT_COLOR_CYAN "\033[36m"
25 #define FONT_COLOR_GRAY "\033[37m"
27 #define PRINT_FUNC_LINE
29 #ifdef PRINT_FUNC_LINE
30 #define TSP_DEBUG(fmt, args ...) LOGD("[%s : <%05d>] " fmt, __func__, __LINE__, ##args)
31 #define TSP_WARN(fmt, args ...) LOGW(FONT_COLOR_YELLOW "[%s : <%05d>] " fmt FONT_COLOR_RESET, __func__, __LINE__, ##args)
32 #define TSP_ERROR(fmt, args ...) LOGE(FONT_COLOR_RED "[%s : <%05d>] ####" fmt "####"FONT_COLOR_RESET, __func__, __LINE__, ##args)
33 #define TSP_FUNC_ENTER() LOGD(FONT_COLOR_BLUE "[%s : <%05d>] <<<< enter!!"FONT_COLOR_RESET, __func__, __LINE__)
34 #define TSP_FUNC_LEAVE() LOGD(FONT_COLOR_BLUE "[%s : <%05d>] >>>> leave!!"FONT_COLOR_RESET, __func__, __LINE__)
36 #define TSP_DEBUG(fmt, args ...) LOGD("[AT] " fmt "\n", ##args)
37 #define TSP_WARN(fmt, args ...) LOGW(FONT_COLOR_YELLOW "[AT] " fmt "\n"FONT_COLOR_RESET, ##args)
38 #define TSP_ERROR(fmt, args ...) LOGE(FONT_COLOR_RED "[AT] " fmt "\n"FONT_COLOR_RESET, ##args)
39 #define TSP_FUNC_ENTER() LOGD(FONT_COLOR_BLUE "*********************** [Func: %s] enter!! ********************* \n"FONT_COLOR_RESET, __func__)
40 #define TSP_FUNC_LEAVE() LOGD(FONT_COLOR_BLUE "*********************** [Func: %s] leave!! ********************* \n"FONT_COLOR_RESET, __func__)
46 #define TSP_DEBUG(fmt, args ...)
50 #define TSP_WARN(fmt, args ...)
54 #define TSP_FUNC_ENTER(fmt, args ...)
58 #define TSP_FUNC_LEAVE(fmt, args ...)
59 #ifdef PRINT_FUNC_LINE
60 #define TSP_ERROR(fmt, args ...) LOGE(FONT_COLOR_RED "[%s : <%05d>] ####" fmt "####"FONT_COLOR_RESET, __func__, __LINE__, ##args)
62 #define TSP_ERROR(fmt, args ...) LOGE(FONT_COLOR_RED "[AT] " fmt "\n"FONT_COLOR_RESET, ##args)
66 #define TSP_RET_IF(expr) do { \
68 TSP_ERROR("[%s] Return", #expr); \
73 #define TSP_RETV_IF(expr, val) do { \
75 TSP_ERROR("[%s] Return value", #expr); \
79 #define TSP_RETM_IF(expr, fmt, args ...) do { \
81 TSP_ERROR("[%s] Return, message "fmt, #expr, ##args); \
85 #define TSP_RETVM_IF(expr, val, fmt, args ...) do { \
87 TSP_ERROR("[%s] Return value, message "fmt, #expr, ##args); \
92 #define TSP_CHECK(expr) TSP_RETM_IF(!(expr), "Invalid param")
93 #define TSP_CHECK_NULL(expr) TSP_RETVM_IF(!(expr), NULL, "Invalid param")
94 #define TSP_CHECK_FALSE(expr) TSP_RETVM_IF(!(expr), false, "Invalid param")
95 #define TSP_CHECK_VAL(expr, val) TSP_RETVM_IF(!(expr), val, "Invalid param")
97 #define TSP_ASSERT(expr) do { \
99 TSP_ERROR("CRITICAL ERROR ########################################## CHECK BELOW ITEM"); \
104 #endif /* __TSP_LOG_H__ */