All pastes #816222 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-12-14 18:26 UTC
rendered paste body
putnopvut@putnopvut-desktop:/usr/src/asterisk$ sudo svn diff
Index: funcs/func_timeout.c
===================================================================
--- funcs/func_timeout.c        (revision 92976)
+++ funcs/func_timeout.c        (working copy)
@@ -106,7 +106,7 @@
        case 'a':
        case 'A':
                ast_channel_setwhentohangup(chan, x);
-               if(option_verbose > 2) {
+               if(VERBOSITY_LEVEL(2)) {
                        if (chan->whentohangup) {
                                struct timeval tv = { chan->whentohangup, 0 };
                                ast_strftime(timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S.%3q %Z",
Index: include/asterisk/logger.h
===================================================================
--- include/asterisk/logger.h   (revision 92875)
+++ include/asterisk/logger.h   (working copy)
@@ -154,8 +154,10 @@
                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) \