bug #8076 check option_debug before printing to debug channel.

patch provided in bugnote, with minor changes.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Matt O'Gorman
2006-10-03 15:53:07 +00:00
parent c9c1613503
commit ae8cc3e18b
67 changed files with 1718 additions and 922 deletions

View File

@@ -67,8 +67,9 @@ static int function_db_read(struct ast_channel *chan, char *cmd,
}
if (ast_db_get(args.family, args.key, buf, len - 1)) {
ast_log(LOG_DEBUG, "DB: %s/%s not found in database.\n", args.family,
args.key);
if (option_debug)
ast_log(LOG_DEBUG, "DB: %s/%s not found in database.\n", args.family,
args.key);
} else
pbx_builtin_setvar_helper(chan, "DB_RESULT", buf);
@@ -182,11 +183,13 @@ static int function_db_delete(struct ast_channel *chan, char* cmd,
}
if (ast_db_get(args.family, args.key, buf, len - 1)) {
ast_log(LOG_DEBUG, "DB_DELETE: %s/%s not found in database.\n", args.family, args.key);
if (option_debug)
ast_log(LOG_DEBUG, "DB_DELETE: %s/%s not found in database.\n", args.family, args.key);
} else {
if (ast_db_del(args.family, args.key)) {
ast_log(LOG_DEBUG, "DB_DELETE: %s/%s could not be deleted from the database\n",
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);
}
}
pbx_builtin_setvar_helper(chan, "DB_RESULT", buf);