[Asterisk-code-review] pbx: Reduce verbosity while loading extensions (asterisk[13])

Corey Farrell asteriskteam at digium.com
Tue Jan 16 22:26:19 CST 2018


Corey Farrell has uploaded this change for review. ( https://gerrit.asterisk.org/7981


Change subject: pbx: Reduce verbosity while loading extensions
......................................................................

pbx: Reduce verbosity while loading extensions

Each time the dial plan is reloaded, a lot of logs like these are generated:
"Added extension 'XXXXX' priority 1 to YYYYYYYYYYY"
This patch changes the log level for those logs.

ASTERISK-27084

Change-Id: I5662902161c50890997ddc56835d4cafb456c529
---
M CHANGES
M main/config.c
M main/pbx.c
3 files changed, 15 insertions(+), 12 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/81/7981/1

diff --git a/CHANGES b/CHANGES
index 9cb80f1..f3e6bec 100644
--- a/CHANGES
+++ b/CHANGES
@@ -9,6 +9,16 @@
 ==============================================================================
 
 ------------------------------------------------------------------------------
+--- Functionality changes from Asterisk 13.19.0 to Asterisk 13.20.0 ----------
+------------------------------------------------------------------------------
+
+Core
+------------------
+ * During dialplan reload log messages are produced for each context,
+   extension and include.  These messages are no longer printed by the
+   verbose loggers, they are now only logged as debug messages.
+
+------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 13.18.0 to Asterisk 13.19.0 ----------
 ------------------------------------------------------------------------------
 
diff --git a/main/config.c b/main/config.c
index e686c23..d022b6a 100644
--- a/main/config.c
+++ b/main/config.c
@@ -2193,7 +2193,6 @@
 				/* If we get to this point, then we're loading regardless */
 				ast_clear_flag(&flags, CONFIG_FLAG_FILEUNCHANGED);
 				ast_debug(1, "Parsing %s\n", fn);
-				ast_verb(2, "Parsing '%s': Found\n", fn);
 				while (!feof(f)) {
 					lineno++;
 					if (fgets(buf, sizeof(buf), f)) {
diff --git a/main/pbx.c b/main/pbx.c
index b313e05..4b29ed5 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -6142,15 +6142,14 @@
 		*local_contexts = tmp;
 		ast_hashtab_insert_safe(contexts_table, tmp); /*put this context into the tree */
 		ast_unlock_contexts();
-		ast_verb(3, "Registered extension context '%s'; registrar: %s\n", tmp->name, registrar);
 	} else {
 		tmp->next = *local_contexts;
 		if (exttable)
 			ast_hashtab_insert_immediate(exttable, tmp); /*put this context into the tree */
 
 		*local_contexts = tmp;
-		ast_verb(3, "Registered extension context '%s'; registrar: %s\n", tmp->name, registrar);
 	}
+	ast_debug(1, "Registered extension context '%s'; registrar: %s\n", tmp->name, registrar);
 	return tmp;
 }
 
@@ -6310,6 +6309,7 @@
 	struct ast_state_cb *thiscb;
 	struct ast_hashtab_iter *iter;
 	struct ao2_iterator i;
+	int ctx_count = 0;
 	struct timeval begintime;
 	struct timeval writelocktime;
 	struct timeval endlocktime;
@@ -6342,6 +6342,7 @@
 
 	iter = ast_hashtab_start_traversal(contexts_table);
 	while ((tmp = ast_hashtab_next(iter))) {
+		++ctx_count;
 		context_merge(extcontexts, exttable, tmp, registrar);
 	}
 	ast_hashtab_end_traversal(iter);
@@ -6514,6 +6515,7 @@
 	ft = ast_tvdiff_us(enddeltime, begintime);
 	ft /= 1000000.0;
 	ast_verb(3,"Total time merge_contexts_delete: %8.6f sec\n", ft);
+	ast_verb(3, "%s successfully loaded %d contexts (enable debug for details).\n", registrar, ctx_count);
 }
 
 /*
@@ -6591,7 +6593,7 @@
 		il->next = new_include;
 	else
 		con->includes = new_include;
-	ast_verb(3, "Including context '%s' in context '%s'\n", new_include->name, ast_get_context_name(con));
+	ast_debug(1, "Including context '%s' in context '%s'\n", new_include->name, ast_get_context_name(con));
 
 	ast_unlock_context(con);
 
@@ -7430,14 +7432,6 @@
 			ast_debug(1, "Added extension '%s' priority %d to %s (%p)\n",
 					  tmp->name, tmp->priority, con->name, con);
 		}
-	}
-
-	if (tmp->matchcid == AST_EXT_MATCHCID_ON) {
-		ast_verb(3, "Added extension '%s' priority %d (CID match '%s') to %s\n",
-				 tmp->name, tmp->priority, tmp->cidmatch_display, con->name);
-	} else {
-		ast_verb(3, "Added extension '%s' priority %d to %s\n",
-				 tmp->name, tmp->priority, con->name);
 	}
 
 	return 0;

-- 
To view, visit https://gerrit.asterisk.org/7981
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5662902161c50890997ddc56835d4cafb456c529
Gerrit-Change-Number: 7981
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Benoît Dereck-Tricot <benoit.dereck-tricot at eyepea.eu>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180116/22e80233/attachment-0001.html>


More information about the asterisk-code-review mailing list