[svn-commits] mjordan: trunk r402155 - in /trunk: ./ main/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Oct 29 07:57:37 CDT 2013


Author: mjordan
Date: Tue Oct 29 07:57:35 2013
New Revision: 402155

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=402155
Log:
Remove some spammy debug messages; improve clarity of others

Debug messages aren't free. Even when the debug level is sufficiently low such
that the messages are never evaluated, there is a cost to having to parse
Asterisk logs that contain debug messages that (a) fail to convey sufficient
information or (b) occur so frequently as to be next to meaningless. Based on
having to stare at lots of DEBUG messages, this patch makes the following
changes:

* channel.c: When copying variables from a parent channel to a child channel,
  specify the channels involved. Do not log anything for a variable that is not
  inherited; the fact that it doesn't have an _ or __ already signifies that it
  won't be inherited.
* pbx.c: Specify what function evaluation has occurred that created the result.
* translate.c: Bump up the translator path messages to 10. I've never once had
  to use these debug messages, and for each format that is registered (on
  startup) and unregistered (on shutdown) the entire f^2 matrix is logged out.
  For short tests in the Asterisk Test Suite, this should make finding the
  actual test much easier.
* xmldoc.c: The debug message that 'blah' is not found in the tree is expected.
  Often, description elements - which are not required - are not provided.
  This debug message adds no additional value, as it is not indicative of an
  error or helpful in debugging which element did not contain a 'blah' element
  as a child. If an element is supposed to contain a child element, then that
  XML tree should have failed validation in the first place.

Review: https://reviewboard.asterisk.org/r/2966/
........

Merged revisions 402150 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 402151 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 402154 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/main/channel.c
    trunk/main/pbx.c
    trunk/main/translate.c
    trunk/main/xmldoc.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: trunk/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/channel.c?view=diff&rev=402155&r1=402154&r2=402155
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Tue Oct 29 07:57:35 2013
@@ -6346,18 +6346,19 @@
 			newvar = ast_var_assign(&varname[1], ast_var_value(current));
 			if (newvar) {
 				AST_LIST_INSERT_TAIL(ast_channel_varshead(child), newvar, entries);
-				ast_debug(1, "Copying soft-transferable variable %s.\n", ast_var_name(newvar));
+				ast_debug(1, "Inheriting variable %s from %s to %s.\n",
+					ast_var_name(newvar), ast_channel_name(parent), ast_channel_name(child));
 			}
 			break;
 		case 2:
 			newvar = ast_var_assign(varname, ast_var_value(current));
 			if (newvar) {
 				AST_LIST_INSERT_TAIL(ast_channel_varshead(child), newvar, entries);
-				ast_debug(1, "Copying hard-transferable variable %s.\n", ast_var_name(newvar));
+				ast_debug(1, "Inheriting variable %s from %s to %s.\n",
+					ast_var_name(newvar), ast_channel_name(parent), ast_channel_name(child));
 			}
 			break;
 		default:
-			ast_debug(1, "Not copying variable %s.\n", ast_var_name(current));
 			break;
 		}
 	}

Modified: trunk/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/pbx.c?view=diff&rev=402155&r1=402154&r2=402155
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Tue Oct 29 07:57:35 2013
@@ -4323,7 +4323,7 @@
 						ast_log(LOG_ERROR, "Unable to allocate bogus channel for variable substitution.  Function results may be blank.\n");
 					}
 				}
-				ast_debug(2, "Function result is '%s'\n", cp4 ? cp4 : "(null)");
+				ast_debug(2, "Function %s result is '%s'\n", finalvars, cp4 ? cp4 : "(null)");
 			} else {
 				/* Retrieve variable value */
 				ast_str_retrieve_variable(&substr3, 0, c, headp, finalvars);
@@ -4523,7 +4523,7 @@
 						ast_log(LOG_ERROR, "Unable to allocate bogus channel for variable substitution.  Function results may be blank.\n");
 					}
 				}
-				ast_debug(2, "Function result is '%s'\n", cp4 ? cp4 : "(null)");
+				ast_debug(2, "Function %s result is '%s'\n", vars, cp4 ? cp4 : "(null)");
 			} else {
 				/* Retrieve variable value */
 				pbx_retrieve_variable(c, vars, &cp4, workspace, VAR_BUF_SIZE, headp);

Modified: trunk/main/translate.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/translate.c?view=diff&rev=402155&r1=402154&r2=402155
==============================================================================
--- trunk/main/translate.c (original)
+++ trunk/main/translate.c Tue Oct 29 07:57:35 2013
@@ -771,7 +771,7 @@
 						matrix_get(x, z)->table_cost = newtablecost;
 						matrix_get(x, z)->multistep = 1;
 						changed++;
-						ast_debug(3, "Discovered %d cost path from %s to %s, via %s\n",
+						ast_debug(10, "Discovered %d cost path from %s to %s, via %s\n",
 							matrix_get(x, z)->table_cost,
 							ast_getformatname(ast_format_set(&tmpx, index2format(x), 0)),
 							ast_getformatname(ast_format_set(&tmpy, index2format(z), 0)),

Modified: trunk/main/xmldoc.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/xmldoc.c?view=diff&rev=402155&r1=402154&r2=402155
==============================================================================
--- trunk/main/xmldoc.c (original)
+++ trunk/main/xmldoc.c Tue Oct 29 07:57:35 2013
@@ -2186,7 +2186,6 @@
 	node = ast_xml_find_element(ast_xml_node_get_children(node), var, NULL, NULL);
 
 	if (!node || !ast_xml_node_get_children(node)) {
-		ast_debug(1, "Cannot find variable '%s' in tree\n", var);
 		return ret;
 	}
 




More information about the svn-commits mailing list