[asterisk-commits] rmudgett: branch rmudgett/ast_verb r405292 - in /team/rmudgett/ast_verb: apps...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 10 13:04:42 CST 2014


Author: rmudgett
Date: Fri Jan 10 13:04:38 2014
New Revision: 405292

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=405292
Log:
Address reviewboard feedback.

Modified:
    team/rmudgett/ast_verb/apps/app_dumpchan.c
    team/rmudgett/ast_verb/apps/app_verbose.c
    team/rmudgett/ast_verb/main/cli.c
    team/rmudgett/ast_verb/main/logger.c

Modified: team/rmudgett/ast_verb/apps/app_dumpchan.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ast_verb/apps/app_dumpchan.c?view=diff&rev=405292&r1=405291&r2=405292
==============================================================================
--- team/rmudgett/ast_verb/apps/app_dumpchan.c (original)
+++ team/rmudgett/ast_verb/apps/app_dumpchan.c Fri Jan 10 13:04:38 2014
@@ -182,15 +182,17 @@
 	if (!ast_strlen_zero(data))
 		level = atoi(data);
 
-	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);
+	if (VERBOSITY_ATLEAST(level)) {
+		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;
 }

Modified: team/rmudgett/ast_verb/apps/app_verbose.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ast_verb/apps/app_verbose.c?view=diff&rev=405292&r1=405291&r2=405292
==============================================================================
--- team/rmudgett/ast_verb/apps/app_verbose.c (original)
+++ team/rmudgett/ast_verb/apps/app_verbose.c Fri Jan 10 13:04:38 2014
@@ -96,9 +96,11 @@
 		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);

Modified: team/rmudgett/ast_verb/main/cli.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ast_verb/main/cli.c?view=diff&rev=405292&r1=405291&r2=405292
==============================================================================
--- team/rmudgett/ast_verb/main/cli.c (original)
+++ team/rmudgett/ast_verb/main/cli.c Fri Jan 10 13:04:38 2014
@@ -380,12 +380,10 @@
 static void status_debug_verbose(struct ast_cli_args *a, const char *what, int old_val, int cur_val)
 {
 	if (old_val == cur_val) {
-		const char *still = "is still";
-
 		if (old_val) {
-			ast_cli(a->fd, "%s %s %d.\n", what, still, old_val);
+			ast_cli(a->fd, "%s is still %d.\n", what, old_val);
 		} else {
-			ast_cli(a->fd, "%s %s OFF.\n", what, still);
+			ast_cli(a->fd, "%s is still OFF.\n", what);
 		}
 	} else {
 		char was_buf[30];

Modified: team/rmudgett/ast_verb/main/logger.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/ast_verb/main/logger.c?view=diff&rev=405292&r1=405291&r2=405292
==============================================================================
--- team/rmudgett/ast_verb/main/logger.c (original)
+++ team/rmudgett/ast_verb/main/logger.c Fri Jan 10 13:04:38 2014
@@ -349,6 +349,7 @@
 		chan->type = LOGTYPE_FILE;
 	}
 	make_components(chan);
+
 	return chan;
 }
 
@@ -1983,7 +1984,7 @@
 {
 	struct verb_console *console;
 
-	console = ast_threadstorage_get(&my_verb_console, sizeof(struct verb_console));
+	console = ast_threadstorage_get(&my_verb_console, sizeof(*console));
 	if (!console || !level) {
 		return;
 	}
@@ -1999,7 +2000,7 @@
 {
 	struct verb_console *console;
 
-	console = ast_threadstorage_get(&my_verb_console, sizeof(struct verb_console));
+	console = ast_threadstorage_get(&my_verb_console, sizeof(*console));
 	if (!console) {
 		return;
 	}
@@ -2011,7 +2012,7 @@
 	struct verb_console *console;
 	int verb_level;
 
-	console = ast_threadstorage_get(&my_verb_console, sizeof(struct verb_console));
+	console = ast_threadstorage_get(&my_verb_console, sizeof(*console));
 	AST_RWLIST_RDLOCK(&verb_consoles);
 	if (!console) {
 		verb_level = 0;
@@ -2028,7 +2029,7 @@
 {
 	struct verb_console *console;
 
-	console = ast_threadstorage_get(&my_verb_console, sizeof(struct verb_console));
+	console = ast_threadstorage_get(&my_verb_console, sizeof(*console));
 	if (!console) {
 		return;
 	}




More information about the asterisk-commits mailing list