summaryrefslogtreecommitdiff
path: root/apps/app_verbose.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2014-01-14 18:14:02 +0000
committerRichard Mudgett <rmudgett@digium.com>2014-01-14 18:14:02 +0000
commit828f339a9cb52cdcb62c28962d87a5187dc7c5bc (patch)
tree0081ea00504678b5bc432cbdad91ba77493b4dab /apps/app_verbose.c
parentaced8bdd2e5d210f024be602bf5a1e70555ecec4 (diff)
verbosity: Fix performance of console verbose messages.
The per console verbose level feature as previously implemented caused a large performance penalty. The fix required some minor incompatibilities if the new rasterisk is used to connect to an earlier version. If the new rasterisk connects to an older Asterisk version then the root console verbose level is always affected by the "core set verbose" command of the remote console even though it may appear to only affect the current console. If an older version of rasterisk connects to the new version then the "core set verbose" command will have no effect. * Fixed the verbose performance by not generating a verbose message if nothing is going to use it and then filtered any generated verbose messages before actually sending them to the remote consoles. * Split the "core set debug" and "core set verbose" CLI commands to remove the per module verbose support that cannot work with the per console verbose level. * Added a silent option to the "core set verbose" command. * Fixed "core set debug off" tab completion. * Made "core show settings" list the current console verbosity in addition to the root console verbosity. * Changed the default verbose level of the 'verbose' setting in the logger.conf [logfiles] section. The default is now to once again follow the current root console level. As a result, using the AMI Command action with "core set verbose" could again set the root console verbose level and affect the verbose level logged. (closes issue AST-1252) Reported by: Guenther Kelleter Review: https://reviewboard.asterisk.org/r/3114/ ........ Merged revisions 405431 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 405432 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_verbose.c')
-rw-r--r--apps/app_verbose.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/app_verbose.c b/apps/app_verbose.c
index 394c48991..8d285b02f 100644
--- a/apps/app_verbose.c
+++ b/apps/app_verbose.c
@@ -96,9 +96,11 @@ static int verbose_exec(struct ast_channel *chan, const char *data)
args.level = "0";
}
- if (sscanf(args.level, "%30d", &vsize) != 1) {
+ if (sscanf(args.level, "%30u", &vsize) != 1) {
vsize = 0;
ast_log(LOG_WARNING, "'%s' is not a verboser number\n", args.level);
+ } else if (4 < vsize) {
+ vsize = 4;
}
ast_verb(vsize, "%s\n", args.msg);