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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@397958 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin Harwell
2013-08-29 22:45:15 +00:00
parent 26448e0839
commit e7dcc5494f
5 changed files with 130 additions and 116 deletions

View File

@@ -183,17 +183,15 @@ static int dumpchan_exec(struct ast_channel *chan, const char *data)
if (!ast_strlen_zero(data))
level = atoi(data);
if (option_verbose >= level) {
serialize_showchan(chan, info, sizeof(info));
pbx_builtin_serialize_variables(chan, &vars);
ast_verbose("\n"
"Dumping Info For Channel: %s:\n"
"%s\n"
"Info:\n"
"%s\n"
"Variables:\n"
"%s%s\n", ast_channel_name(chan), line, info, ast_str_buffer(vars), line);
}
serialize_showchan(chan, info, sizeof(info));
pbx_builtin_serialize_variables(chan, &vars);
ast_verb(level, "\n"
"Dumping Info For Channel: %s:\n"
"%s\n"
"Info:\n"
"%s\n"
"Variables:\n"
"%s%s\n", ast_channel_name(chan), line, info, ast_str_buffer(vars), line);
return 0;
}

View File

@@ -63,7 +63,7 @@ static char *app_log = "Log";
<syntax>
<parameter name="level" required="true">
<para>Level must be one of <literal>ERROR</literal>, <literal>WARNING</literal>, <literal>NOTICE</literal>,
<literal>DEBUG</literal>, <literal>VERBOSE</literal> or <literal>DTMF</literal>.</para>
<literal>DEBUG</literal>, <literal>VERBOSE</literal> or <literal>DTMF</literal>.</para>
</parameter>
<parameter name="message" required="true">
<para>Output text message.</para>
@@ -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)