From d7b9a702d8c3705bf6c736d2df166f51981fc006 Mon Sep 17 00:00:00 2001 From: Kevin Harwell Date: Thu, 29 Aug 2013 22:49:24 +0000 Subject: Verbose logging discrepancies Refactored cases where a combination of ast_verbose/options_verbose were present. Also in general tried to eliminate, in as many places as possible, where the options_verbose global variable was being used. Refactored the way local and remote consoles handle verbose message logging in an attempt to solve the various discrepancies that sometimes would show between the two. (closes issue AST-1193) Reported by: Guenther Kelleter Review: https://reviewboard.asterisk.org/r/2798/ ........ Merged revisions 397948 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 397958 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397959 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_verbose.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'apps/app_verbose.c') diff --git a/apps/app_verbose.c b/apps/app_verbose.c index b981fb9c8..394c48991 100644 --- a/apps/app_verbose.c +++ b/apps/app_verbose.c @@ -63,7 +63,7 @@ static char *app_log = "Log"; Level must be one of ERROR, WARNING, NOTICE, - DEBUG, VERBOSE or DTMF. + DEBUG, VERBOSE or DTMF. Output text message. @@ -100,24 +100,8 @@ static int verbose_exec(struct ast_channel *chan, const char *data) vsize = 0; ast_log(LOG_WARNING, "'%s' is not a verboser number\n", args.level); } - if (option_verbose >= vsize) { - switch (vsize) { - case 0: - ast_verb(0, "%s\n", args.msg); - break; - case 1: - ast_verb(1, "%s\n", args.msg); - break; - case 2: - ast_verb(2, "%s\n", args.msg); - break; - case 3: - ast_verb(3, "%s\n", args.msg); - break; - default: - ast_verb(4, "%s\n", args.msg); - } - } + + ast_verb(vsize, "%s\n", args.msg); return 0; } @@ -171,7 +155,7 @@ static int unload_module(void) res = ast_unregister_application(app_verbose); res |= ast_unregister_application(app_log); - return res; + return res; } static int load_module(void) -- cgit v1.2.3