summaryrefslogtreecommitdiff
path: root/include/asterisk/logger.h
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2014-07-14 14:55:30 +0000
committerRichard Mudgett <rmudgett@digium.com>2014-07-14 14:55:30 +0000
commit874f075025f5282ba05ad323d0a73454cc63ebd4 (patch)
tree46c8b889fb56f154d6e6825edde30a5fb000c07e /include/asterisk/logger.h
parent4339183c3e92ac8d080e7ccb17f85c032a60733b (diff)
logger.h: Extract DEBUG_ATLEAST() to complement VERBOSITY_ATLEAST().
........ Merged revisions 418586 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/logger.h')
-rw-r--r--include/asterisk/logger.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/asterisk/logger.h b/include/asterisk/logger.h
index e10568320..84e6991f0 100644
--- a/include/asterisk/logger.h
+++ b/include/asterisk/logger.h
@@ -390,15 +390,21 @@ void ast_callid_strnprint(char *buffer, size_t buffer_size, struct ast_callid *c
#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;