[svn-commits] russell: trunk r68987 - /trunk/include/asterisk/logger.h

svn-commits at lists.digium.com svn-commits at lists.digium.com
Tue Jun 12 09:11:40 MST 2007


Author: russell
Date: Tue Jun 12 11:11:40 2007
New Revision: 68987

URL: http://svn.digium.com/view/asterisk?view=rev&rev=68987
Log:
Add a new macro, ast_debug(), which combines the check of the value of
option_debug and the actual call to ast_log().
(issue #9925, dimas)

Modified:
    trunk/include/asterisk/logger.h

Modified: trunk/include/asterisk/logger.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/logger.h?view=diff&rev=68987&r1=68986&r2=68987
==============================================================================
--- trunk/include/asterisk/logger.h (original)
+++ trunk/include/asterisk/logger.h Tue Jun 12 11:11:40 2007
@@ -129,6 +129,17 @@
 #define __LOG_DTMF  6
 #define LOG_DTMF    __LOG_DTMF, _A_
 
+/*!
+ * \brief Log a DEBUG message
+ * \param level The minimum value of option_debug for this message
+ *        to get logged
+ */
+#define ast_debug(level, ...) do {       \
+	if (option_debug >= level) {         \
+		ast_log(LOG_DEBUG, __VA_ARGS__); \
+	}                                    \
+} while (0)
+
 #if defined(__cplusplus) || defined(c_plusplus)
 }
 #endif



More information about the svn-commits mailing list