aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-12 16:11:40 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-12 16:11:40 +0000
commit4f582d3ad940e3920c713919a5ab1e05f08f12ba (patch)
tree97d939797f39a75640014e5326a53b0d95526adb /include
parenta1218722aef9a89da652dd0182438de1a51cd470 (diff)
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: http://svn.digium.com/svn/asterisk/trunk@68987 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/logger.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/asterisk/logger.h b/include/asterisk/logger.h
index b4737d06c..057160c56 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