From: Russell Bryant Date: Tue, 12 Jun 2007 16:11:40 +0000 (+0000) Subject: Add a new macro, ast_debug(), which combines the check of the value of X-Git-Tag: 1.6.0-beta1~3^2~2393 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f437de52357cdc623a655b1a372ea806d76b32f;p=thirdparty%2Fasterisk.git 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) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@68987 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/include/asterisk/logger.h b/include/asterisk/logger.h index b4737d06cf..057160c566 100644 --- a/include/asterisk/logger.h +++ b/include/asterisk/logger.h @@ -129,6 +129,17 @@ void ast_console_toggle_mute(int fd); #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