summaryrefslogtreecommitdiff
path: root/include/avsys-debug.h
diff options
context:
space:
mode:
authorSangchul Lee <sc11.lee@samsung.com>2015-01-08 14:20:50 (GMT)
committerSangchul Lee <sc11.lee@samsung.com>2015-01-08 14:21:11 (GMT)
commit6c769f64f84c1bfaa8a05d9ca9288cd13b8cb700 (patch)
tree4fd077332a578a1f03186519fc22bcfafef0ca43 /include/avsys-debug.h
parent5a1a67f96e9b7d33c4010d1fb3a35dd90963f72d (diff)
downloadavsystem-6c769f64f84c1bfaa8a05d9ca9288cd13b8cb700.zip
avsystem-6c769f64f84c1bfaa8a05d9ca9288cd13b8cb700.tar.gz
avsystem-6c769f64f84c1bfaa8a05d9ca9288cd13b8cb700.tar.bz2
Change-Id: I84380907c9144cca63193062d2a579848e71629a
Diffstat (limited to 'include/avsys-debug.h')
-rw-r--r--include/avsys-debug.h32
1 files changed, 23 insertions, 9 deletions
diff --git a/include/avsys-debug.h b/include/avsys-debug.h
index d7ded66..b662a3b 100644
--- a/include/avsys-debug.h
+++ b/include/avsys-debug.h
@@ -40,26 +40,38 @@
#ifdef __DEBUG_MODE__
#ifdef __USE_LOGMANAGER__
-#define avsys_info_r(owner, msg, args...) log_print_rel( owner, LOG_CLASS_INFO, msg, ##args )
-#define avsys_warning_r(owner, msg, args...) log_print_rel( owner, LOG_CLASS_WARNING, msg, ##args )
-#define avsys_error_r(owner, msg, args...) log_print_rel( owner, LOG_CLASS_ERR, msg, ##args )
-#define avsys_critical_r(owner, msg, args...) log_print_rel( owner, LOG_CLASS_CRITICAL, msg, ##args )
+#define log_assert_rel(condition) \
+ do { \
+ if(!(condition)) { \
+ mm_log_by_owner(0, LOG_FATAL, "Assertion Fail", NULL); \
+ abort(); \
+ } \
+ } while(0)
+
+#define avsys_debug_r(owner, msg, args...) mm_log_by_owner( owner, LOG_DEBUG, msg, ##args )
+#define avsys_info_r(owner, msg, args...) mm_log_by_owner( owner, LOG_INFO, msg, ##args )
+#define avsys_warning_r(owner, msg, args...) mm_log_by_owner( owner, LOG_WARN, msg, ##args )
+#define avsys_error_r(owner, msg, args...) mm_log_by_owner( owner, LOG_ERROR, msg, ##args )
+#define avsys_critical_r(owner, msg, args...) mm_log_by_owner( owner, LOG_FATAL, msg, ##args )
#define avsys_assert_r(condition) log_assert_rel(( condition ))
-#define avsys_info(owner, msg, args...) log_print_dbg( owner, LOG_CLASS_INFO, msg, ##args )
-#define avsys_warning(owner, msg, args...) log_print_dbg( owner, LOG_CLASS_WARNING, msg, ##args )
-#define avsys_error(owner, msg, args...) log_print_dbg( owner, LOG_CLASS_ERR, msg, ##args )
-#define avsys_critical(owner, msg, args...) log_print_dbg( owner, LOG_CLASS_CRITICAL, msg, ##args )
-#define avsys_assert(condition) log_assert_dbg( (condition) )
+#define avsys_debug(owner, msg, args...) mm_log_by_owner( owner, LOG_DEBUG, msg, ##args )
+#define avsys_info(owner, msg, args...) mm_log_by_owner( owner, LOG_INFO, msg, ##args )
+#define avsys_warning(owner, msg, args...) mm_log_by_owner( owner, LOG_WARN, msg, ##args )
+#define avsys_error(owner, msg, args...) mm_log_by_owner( owner, LOG_ERROR, msg, ##args )
+#define avsys_critical(owner, msg, args...) mm_log_by_owner( owner, LOG_FATAL, msg, ##args )
+#define avsys_assert(condition) log_assert_rel( (condition) )
#else /* __USE_LOGMANAGER__ */
+#define avsys_debug_r(owner, msg, args...) fprintf(stderr, msg, ##args)
#define avsys_info_r(owner, msg, args...) fprintf(stderr, msg, ##args)
#define avsys_warning_r(owner, msg, args...) fprintf(stderr, msg, ##args)
#define avsys_error_r(owner, msg, args...) fprintf(stderr, msg, ##args)
#define avsys_critical_r(owner, msg, args...) fprintf(stderr, msg, ##args)
#define avsys_assert_r(condition) (condition)
+#define avsys_debug(owner, msg, args...) fprintf(stderr, msg, ##args)
#define avsys_info(owner, msg, args...) fprintf(stderr, msg, ##args)
#define avsys_warning(owner, msg, args...) fprintf(stderr, msg, ##args)
#define avsys_error(owner, msg, args...) fprintf(stderr, msg, ##args)
@@ -70,12 +82,14 @@
#else /* __DEBUG_MODE__ */
+#define avsys_debug_r(owner, msg, args...)
#define avsys_info_r(owner, msg, args...)
#define avsys_warning_r(owner, msg, args...)
#define avsys_error_r(owner, msg, args...)
#define avsys_critical_r(owner, msg, args...)
#define avsys_assert_r(condition) (condition)
+#define avsys_debug(owner, msg, args...)
#define avsys_info(owner, msg, args...)
#define avsys_warning(owner, msg, args...)
#define avsys_error(owner, msg, args...)