mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-02 19:16:15 +00:00
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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user