[asterisk-commits] rmudgett: trunk r418587 - in /trunk: ./ include/asterisk/logger.h

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 14 09:55:32 CDT 2014


Author: rmudgett
Date: Mon Jul 14 09:55:30 2014
New Revision: 418587

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=418587
Log:
logger.h: Extract DEBUG_ATLEAST() to complement VERBOSITY_ATLEAST().
........

Merged revisions 418586 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/include/asterisk/logger.h

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: trunk/include/asterisk/logger.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/logger.h?view=diff&rev=418587&r1=418586&r2=418587
==============================================================================
--- trunk/include/asterisk/logger.h (original)
+++ trunk/include/asterisk/logger.h Mon Jul 14 09:55:30 2014
@@ -390,15 +390,21 @@
 
 #define ast_log_dynamic_level(level, ...) ast_log(level, __FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__)
 
+#define DEBUG_ATLEAST(level) \
+	(option_debug >= (level) \
+		|| (ast_opt_dbg_module && ast_debug_get_by_module(AST_MODULE) >= (level)))
+
 /*!
  * \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_opt_dbg_module && ast_debug_get_by_module(AST_MODULE) >= (level)) ) \
-		ast_log(AST_LOG_DEBUG, __VA_ARGS__); \
-} while (0)
+#define ast_debug(level, ...) \
+	do { \
+		if (DEBUG_ATLEAST(level)) { \
+			ast_log(AST_LOG_DEBUG, __VA_ARGS__); \
+		} \
+	} while (0)
 
 extern int ast_verb_sys_level;
 




More information about the asterisk-commits mailing list