diff options
author | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-01-18 22:50:23 +0000 |
---|---|---|
committer | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-01-18 22:50:23 +0000 |
commit | c0d4b5b229746929d5433ad0f5bfa0271922506b (patch) | |
tree | c6bddff5b1c091cea382447d51eaec2382e2fde7 /funcs | |
parent | 0b18c72ed2cec22b08ee8afb0ed6cbb36f31a5a7 (diff) |
Add some more checks for option_debug before ast_log(LOG_DEBUG, ...) calls.
Issue 8832, patch(es) by tgrman
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@51265 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs')
-rw-r--r-- | funcs/func_strings.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/funcs/func_strings.c b/funcs/func_strings.c index 9f911dd71..10712ae92 100644 --- a/funcs/func_strings.c +++ b/funcs/func_strings.c @@ -35,6 +35,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include <regex.h> #include "asterisk/module.h" +#include "asterisk/options.h" #include "asterisk/channel.h" #include "asterisk/pbx.h" #include "asterisk/logger.h" @@ -126,7 +127,8 @@ static int regex(struct ast_channel *chan, char *cmd, char *parse, char *buf, if ((*args.str == ' ') || (*args.str == '\t')) args.str++; - ast_log(LOG_DEBUG, "FUNCTION REGEX (%s)(%s)\n", args.reg, args.str); + if (option_debug) + ast_log(LOG_DEBUG, "FUNCTION REGEX (%s)(%s)\n", args.reg, args.str); if ((errcode = regcomp(®exbuf, args.reg, REG_EXTENDED | REG_NOSUB))) { regerror(errcode, ®exbuf, buf, len); @@ -175,7 +177,8 @@ static int array(struct ast_channel *chan, char *cmd, char *var, * want them to be surprised by the result. Hence, we prefer commas as the * delimiter, but we'll fall back to vertical bars if commas aren't found. */ - ast_log(LOG_DEBUG, "array (%s=%s)\n", var, value2); + if (option_debug) + ast_log(LOG_DEBUG, "array (%s=%s)\n", var, value2); if (strchr(var, ',')) AST_NONSTANDARD_APP_ARGS(arg1, var, ','); else @@ -187,8 +190,9 @@ static int array(struct ast_channel *chan, char *cmd, char *var, AST_STANDARD_APP_ARGS(arg2, value2); for (i = 0; i < arg1.argc; i++) { - ast_log(LOG_DEBUG, "array set value (%s=%s)\n", arg1.var[i], - arg2.val[i]); + if (option_debug) + ast_log(LOG_DEBUG, "array set value (%s=%s)\n", arg1.var[i], + arg2.val[i]); if (i < arg2.argc) { pbx_builtin_setvar_helper(chan, arg1.var[i], arg2.val[i]); } else { |