mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
logger.h: Extract DEBUG_ATLEAST() to complement VERBOSITY_ATLEAST().
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@418586 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -378,15 +378,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 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
|
* \brief Log a DEBUG message
|
||||||
* \param level The minimum value of option_debug for this message
|
* \param level The minimum value of option_debug for this message
|
||||||
* to get logged
|
* to get logged
|
||||||
*/
|
*/
|
||||||
#define ast_debug(level, ...) do { \
|
#define ast_debug(level, ...) \
|
||||||
if (option_debug >= (level) || (ast_opt_dbg_module && ast_debug_get_by_module(AST_MODULE) >= (level)) ) \
|
do { \
|
||||||
ast_log(AST_LOG_DEBUG, __VA_ARGS__); \
|
if (DEBUG_ATLEAST(level)) { \
|
||||||
} while (0)
|
ast_log(AST_LOG_DEBUG, __VA_ARGS__); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
extern int ast_verb_sys_level;
|
extern int ast_verb_sys_level;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user