1 #ifndef __MOMENT_LOG_H__
2 #define __MOMENT_LOG_H__
7 #define LOG_TAG "MOMENTIC"
9 #define COLOR_RED "\033[0;40;31m"
10 #define COLOR_LIGHTBLUE "\033[1;40;34m"
11 #define COLOR_YELLOW "\033[1;40;33m"
12 #define COLOR_END "\033[0;m"
13 #define COLOR_GRAY "\033[1;40;30m"
14 #define COLOR_MAGENTA "\033[1;35m"
17 #define _D(fmt, arg...) dlog_print(DLOG_DEBUG, LOG_TAG, COLOR_YELLOW "[%s:%d] " fmt COLOR_END"\n", __func__, __LINE__, ##arg)
21 #define _W(fmt, arg...) dlog_print(DLOG_WARN, LOG_TAG, COLOR_GRAY "[%s:%d] " fmt COLOR_END"\n", __func__, __LINE__, ##arg)
25 #define _E(fmt, arg...) dlog_print(DLOG_ERROR, LOG_TAG, COLOR_RED "[%s:%d] " fmt COLOR_END"\n", __func__, __LINE__, ##arg)
28 #define retv_if(expr, val) do { \
30 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
35 #define ret_if(expr) do { \
37 _E("(%s) -> %s() return", #expr, __FUNCTION__); \
42 #define goto_if(expr, val) do { \
44 _E("(%s) -> goto", #expr); \
49 #define break_if(expr) { \
51 _E("(%s) -> break", #expr); \
56 #define continue_if(expr) { \
58 _E("(%s) -> continue", #expr); \
63 #endif /* __MOMENT_LOG_H__ */