summaryrefslogtreecommitdiff
path: root/inc/log.h
diff options
context:
space:
mode:
Diffstat (limited to 'inc/log.h')
-rw-r--r--inc/log.h90
1 files changed, 11 insertions, 79 deletions
diff --git a/inc/log.h b/inc/log.h
index 677af94..0e6087b 100644
--- a/inc/log.h
+++ b/inc/log.h
@@ -15,7 +15,7 @@
*/
#ifndef __LOG_H__
-#define __LOG_H__
+#define __LOG_H__
#include <dlog.h>
@@ -23,90 +23,22 @@
extern "C" {
#endif
-#ifdef LOG_TAG
-#undef LOG_TAG
+#ifdef LOG_TAG
+#undef LOG_TAG
#endif
-#define LOG_TAG "sensor"
+#define LOG_TAG "STAPP"
-#if !defined(_D)
-#define _D(fmt, arg...) dlog_print(DLOG_DEBUG, LOG_TAG, "[%s:%d] " fmt "\n", __func__, __LINE__, ##arg)
-#endif
-
-#if !defined(_I)
-#define _I(fmt, arg...) dlog_print(DLOG_INFO, LOG_TAG, "[%s:%d] " fmt "\n", __func__, __LINE__, ##arg)
-#endif
-
-#if !defined(_W)
-#define _W(fmt, arg...) dlog_print(DLOG_WARN, LOG_TAG, "[%s:%d] " fmt "\n", __func__, __LINE__, ##arg)
-#endif
-
-#if !defined(_E)
-#define _E(fmt, arg...) dlog_print(DLOG_ERROR, LOG_TAG, "[%s:%d] " fmt "\n", __func__, __LINE__, ##arg)
-#endif
-
-#define retvm_if(expr, val, fmt, arg...) do { \
- if (expr) { \
- _E(fmt, ##arg); \
- _E("(%s) -> %s() return", #expr, __FUNCTION__); \
- return val; \
- } \
-} while (0)
-
-#define retv_if(expr, val) do { \
- if (expr) { \
- _E("(%s) -> %s() return", #expr, __FUNCTION__); \
- return (val); \
- } \
-} while (0)
-
-#define retm_if(expr, fmt, arg...) do { \
- if (expr) { \
- _E(fmt, ##arg); \
- _E("(%s) -> %s() return", #expr, __FUNCTION__); \
- return; \
- } \
-} while (0)
+#define _E(fmt, args...) dlog_print(DLOG_ERROR, LOG_TAG, "%s : %s(%d) > "fmt"\n", rindex(__FILE__, '/') + 1, __func__, __LINE__, ##args)
+#define _W(fmt, args...) dlog_print(DLOG_WARN, LOG_TAG, "%s : %s(%d) > "fmt"\n", rindex(__FILE__, '/') + 1, __func__, __LINE__, ##args)
+#define _I(fmt, args...) dlog_print(DLOG_INFO, LOG_TAG, "%s : %s(%d) > "fmt"\n", rindex(__FILE__, '/') + 1, __func__, __LINE__, ##args)
+#define _D(fmt, args...) dlog_print(DLOG_DEBUG, LOG_TAG, "%s : %s(%d) > "fmt"\n", rindex(__FILE__, '/') + 1, __func__, __LINE__, ##args)
-#define ret_if(expr) do { \
- if (expr) { \
- _E("(%s) -> %s() return", #expr, __FUNCTION__); \
- return; \
- } \
-} while (0)
-
-#define goto_if(expr, val) do { \
- if (expr) { \
- _E("(%s) -> goto", #expr); \
- goto val; \
- } \
-} while (0)
-
-#define break_if(expr) { \
- if (expr) { \
- _E("(%s) -> break", #expr); \
- break; \
- } \
-}
-
-#define continue_if(expr) { \
- if (expr) { \
- _E("(%s) -> continue", #expr); \
- continue; \
- } \
-}
-
-#define ERR(fmt, args...) dlog_print(DLOG_ERROR, LOG_TAG, "%s : %s(%d) > "fmt"\n", rindex(__FILE__, '/') + 1, __func__, __LINE__, ##args)
-#define WARN(fmt, args...) dlog_print(DLOG_WARN, LOG_TAG, "%s : %s(%d) > "fmt"\n", rindex(__FILE__, '/') + 1, __func__, __LINE__, ##args)
-#define INFO(fmt, args...) dlog_print(DLOG_INFO, LOG_TAG, "%s : %s(%d) > "fmt"\n", rindex(__FILE__, '/') + 1, __func__, __LINE__, ##args)
-#define DBG(fmt, args...) dlog_print(DLOG_DEBUG, LOG_TAG, "%s : %s(%d) > "fmt"\n", rindex(__FILE__, '/') + 1, __func__, __LINE__, ##args)
-
-#define FN_CALL dlog_print(DLOG_DEBUG, LOG_TAG, ">>>>>>>> called")
-#define FN_END dlog_print(DLOG_DEBUG, LOG_TAG, "<<<<<<<< ended")
-
-#define UNUSED(x) (void)(x)
+#define START dlog_print(DLOG_DEBUG, LOG_TAG, "%s : %s(%d) >>>>>>>> called", rindex(__FILE__, '/') + 1, __func__, __LINE__)
+#define END dlog_print(DLOG_DEBUG, LOG_TAG, "%s : %s(%d) <<<<<<<< ended", rindex(__FILE__, '/') + 1, __func__, __LINE__)
#ifdef __cplusplus
}
#endif
+
#endif /* __LOG_H__ */