mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-22 20:56:39 +00:00
Add a massive set of changes for converting to use the ast_debug() macro.
(issue #9957, patches from mvanbaak, caio1982, critch, and dimas) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -69,9 +69,7 @@ static int function_db_read(struct ast_channel *chan, const char *cmd,
|
||||
}
|
||||
|
||||
if (ast_db_get(args.family, args.key, buf, len - 1)) {
|
||||
if (option_debug)
|
||||
ast_log(LOG_DEBUG, "DB: %s/%s not found in database.\n", args.family,
|
||||
args.key);
|
||||
ast_debug(1, "DB: %s/%s not found in database.\n", args.family, args.key);
|
||||
} else
|
||||
pbx_builtin_setvar_helper(chan, "DB_RESULT", buf);
|
||||
|
||||
@@ -185,13 +183,10 @@ static int function_db_delete(struct ast_channel *chan, const char *cmd,
|
||||
}
|
||||
|
||||
if (ast_db_get(args.family, args.key, buf, len - 1)) {
|
||||
if (option_debug)
|
||||
ast_log(LOG_DEBUG, "DB_DELETE: %s/%s not found in database.\n", args.family, args.key);
|
||||
ast_debug(1, "DB_DELETE: %s/%s not found in database.\n", args.family, args.key);
|
||||
} else {
|
||||
if (ast_db_del(args.family, args.key)) {
|
||||
if (option_debug)
|
||||
ast_log(LOG_DEBUG, "DB_DELETE: %s/%s could not be deleted from the database\n",
|
||||
args.family, args.key);
|
||||
ast_debug(1, "DB_DELETE: %s/%s could not be deleted from the database\n", args.family, args.key);
|
||||
}
|
||||
}
|
||||
pbx_builtin_setvar_helper(chan, "DB_RESULT", buf);
|
||||
|
@@ -73,8 +73,7 @@ static int iconv_read(struct ast_channel *chan, const char *cmd, char *arguments
|
||||
|
||||
incount = strlen(args.text);
|
||||
|
||||
if (option_debug)
|
||||
ast_log(LOG_DEBUG, "Iconv: \"%s\" %s -> %s\n", args.text, args.in_charset, args.out_charset);
|
||||
ast_debug(1, "Iconv: \"%s\" %s -> %s\n", args.text, args.in_charset, args.out_charset);
|
||||
|
||||
cd = iconv_open(args.out_charset, args.in_charset);
|
||||
|
||||
|
@@ -66,14 +66,11 @@ static int acf_rand_exec(struct ast_channel *chan, const char *cmd,
|
||||
|
||||
max_int = min_int;
|
||||
min_int = tmp;
|
||||
if (option_debug)
|
||||
ast_log(LOG_DEBUG, "max<min\n");
|
||||
ast_debug(1, "max<min\n");
|
||||
}
|
||||
|
||||
response_int = min_int + (ast_random() % (max_int - min_int + 1));
|
||||
if (option_debug)
|
||||
ast_log(LOG_DEBUG, "%d was the lucky number in range [%d,%d]\n",
|
||||
response_int, min_int, max_int);
|
||||
ast_debug(1, "%d was the lucky number in range [%d,%d]\n", response_int, min_int, max_int);
|
||||
snprintf(buffer, buflen, "%d", response_int);
|
||||
|
||||
ast_module_user_remove(u);
|
||||
|
@@ -146,8 +146,7 @@ static int regex(struct ast_channel *chan, const char *cmd, char *parse, char *b
|
||||
if ((*args.str == ' ') || (*args.str == '\t'))
|
||||
args.str++;
|
||||
|
||||
if (option_debug)
|
||||
ast_log(LOG_DEBUG, "FUNCTION REGEX (%s)(%s)\n", args.reg, args.str);
|
||||
ast_debug(1, "FUNCTION REGEX (%s)(%s)\n", args.reg, args.str);
|
||||
|
||||
if ((errcode = regcomp(®exbuf, args.reg, REG_EXTENDED | REG_NOSUB))) {
|
||||
regerror(errcode, ®exbuf, buf, len);
|
||||
@@ -237,8 +236,7 @@ static int array(struct ast_channel *chan, const 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.
|
||||
*/
|
||||
if (option_debug)
|
||||
ast_log(LOG_DEBUG, "array (%s=%s)\n", var, value2);
|
||||
ast_debug(1, "array (%s=%s)\n", var, value2);
|
||||
if (strchr(var, ','))
|
||||
AST_NONSTANDARD_APP_ARGS(arg1, var, ',');
|
||||
else
|
||||
@@ -250,8 +248,7 @@ static int array(struct ast_channel *chan, const char *cmd, char *var,
|
||||
AST_STANDARD_APP_ARGS(arg2, value2);
|
||||
|
||||
for (i = 0; i < arg1.argc; i++) {
|
||||
if (option_debug)
|
||||
ast_log(LOG_DEBUG, "array set value (%s=%s)\n", arg1.var[i],
|
||||
ast_debug(1, "array set value (%s=%s)\n", arg1.var[i],
|
||||
arg2.val[i]);
|
||||
if (i < arg2.argc) {
|
||||
if (ishash) {
|
||||
|
@@ -76,9 +76,7 @@ static int acf_version_exec(struct ast_channel *chan, const char *cmd,
|
||||
}
|
||||
|
||||
|
||||
if (option_debug)
|
||||
ast_log(LOG_DEBUG, "VERSION returns %s result, given %s argument\n",
|
||||
response_char, args.info);
|
||||
ast_debug(1, "VERSION returns %s result, given %s argument\n", response_char, args.info);
|
||||
snprintf(buffer, buflen, "%s", response_char);
|
||||
|
||||
ast_module_user_remove(u);
|
||||
|
Reference in New Issue
Block a user