diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-14 18:47:44 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-14 18:47:44 +0000 |
commit | 0fecfb254c5cfbd562870cf6d17e6925ccbdbeb7 (patch) | |
tree | 4621fc48e6679b15b0f506ef023841d19e3abc48 /include/asterisk/logger.h | |
parent | 6af365b47c5afc46f6a032aa6f4599e08a4fa174 (diff) |
After reading Russell's e-mail to the dev list stating that checking option_verbose is not
equivalent to the check done by ast_verb, I wrote a macro, VERBOSITY_LEVEL, which does this
check. I did a quick look in the source and used this macro in some places where option_verbose
was used.
I also converted some verbose messages in logger.c to use ast_verb instead of ast_verbose.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@93042 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/logger.h')
-rw-r--r-- | include/asterisk/logger.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/asterisk/logger.h b/include/asterisk/logger.h index cc4abb906..09c099f06 100644 --- a/include/asterisk/logger.h +++ b/include/asterisk/logger.h @@ -154,8 +154,10 @@ unsigned int ast_verbose_get_by_file(const char *file); ast_log(LOG_DEBUG, __VA_ARGS__); \ } while (0) +#define VERBOSITY_LEVEL(level) (option_verbose >= (level) || (ast_opt_verb_file && ast_verbose_get_by_file(__FILE__) >= (level))) + #define ast_verb(level, ...) do { \ - if (option_verbose >= (level) || (ast_opt_verb_file && ast_verbose_get_by_file(__FILE__) >= (level)) ) { \ + if (VERBOSITY_LEVEL((level)) ) { \ if (level >= 4) \ ast_verbose(VERBOSE_PREFIX_4 __VA_ARGS__); \ else if (level == 3) \ |