summaryrefslogtreecommitdiff
path: root/funcs/func_db.c
diff options
context:
space:
mode:
authorMatt O'Gorman <mogorman@digium.com>2006-10-03 15:53:07 +0000
committerMatt O'Gorman <mogorman@digium.com>2006-10-03 15:53:07 +0000
commitae8cc3e18be72c2e074ed33d7cfdc172f8e5f3b1 (patch)
tree27a80e26cf8f6ea1728ab5b2b8cc7573fd9f7cdc /funcs/func_db.c
parentc9c161350343720c2e5f41069c397933c7cbcc56 (diff)
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
Diffstat (limited to 'funcs/func_db.c')
-rw-r--r--funcs/func_db.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/funcs/func_db.c b/funcs/func_db.c
index 13932d27d..2ad135fa0 100644
--- a/funcs/func_db.c
+++ b/funcs/func_db.c
@@ -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);