[asterisk-commits] rmudgett: branch 12 r418586 - /branches/12/include/asterisk/logger.h

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


Author: rmudgett
Date: Mon Jul 14 09:46:11 2014
New Revision: 418586

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

Modified:
    branches/12/include/asterisk/logger.h

Modified: branches/12/include/asterisk/logger.h
URL: http://svnview.digium.com/svn/asterisk/branches/12/include/asterisk/logger.h?view=diff&rev=418586&r1=418585&r2=418586
==============================================================================
--- branches/12/include/asterisk/logger.h (original)
+++ branches/12/include/asterisk/logger.h Mon Jul 14 09:46:11 2014
@@ -378,15 +378,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