]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Remove some spammy debug messages; improve clarity of others
authorMatthew Jordan <mjordan@digium.com>
Tue, 29 Oct 2013 12:40:30 +0000 (12:40 +0000)
committerMatthew Jordan <mjordan@digium.com>
Tue, 29 Oct 2013 12:40:30 +0000 (12:40 +0000)
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/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@402150 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/channel.c
main/pbx.c
main/translate.c
main/xmldoc.c

index d130c3a3dd336b5dcad8ff78e52f22830c9a42fb..16c7e76376f175374766da3724781738aae63386 100644 (file)
@@ -6218,18 +6218,19 @@ void ast_channel_inherit_variables(const struct ast_channel *parent, struct ast_
                        newvar = ast_var_assign(&varname[1], ast_var_value(current));
                        if (newvar) {
                                AST_LIST_INSERT_TAIL(&child->varshead, 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), parent->name, child->name);
                        }
                        break;
                case 2:
                        newvar = ast_var_assign(varname, ast_var_value(current));
                        if (newvar) {
                                AST_LIST_INSERT_TAIL(&child->varshead, 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), parent->name, child->name);
                        }
                        break;
                default:
-                       ast_debug(1, "Not copying variable %s.\n", ast_var_name(current));
                        break;
                }
        }
index 3b7164213b99035452536f213a2d104e3fc84538..ba9834031e73235397941d515b2a1482498378c4 100644 (file)
@@ -4105,7 +4105,7 @@ void ast_str_substitute_variables_full(struct ast_str **buf, ssize_t maxlen, str
                                                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);
@@ -4304,7 +4304,7 @@ void pbx_substitute_variables_helper_full(struct ast_channel *c, struct varshead
                                                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);
index b95cefd25691b650db33c1f369fd0d5de5eeac89..1015ef6ef5009c7cd73acca8c6ac5e5972a5def5 100644 (file)
@@ -613,7 +613,7 @@ static void rebuild_matrix(int samples)
                                         * then this is a up sample down sample conversion scenario. */
                                        tr_matrix[x][z].rate_change = tr_matrix[x][y].rate_change + tr_matrix[y][z].rate_change;
 
-                                       ast_debug(3, "Discovered %d cost path from %s to %s, via %s\n", tr_matrix[x][z].cost,
+                                       ast_debug(10, "Discovered %d cost path from %s to %s, via %s\n", tr_matrix[x][z].cost,
                                                  ast_getformatname(1LL << x), ast_getformatname(1LL << z), ast_getformatname(1LL << y));
                                        changed++;
                                }
index 59f89de051b15fff9aae497ab01659dc7887007b..eeefdb3cad3865999930118c3154b16ddf8d5b34 100644 (file)
@@ -1879,7 +1879,6 @@ static char *xmldoc_build_field(const char *type, const char *name, const char *
        node = ast_xml_find_element(ast_xml_node_get_children(node), var, NULL, NULL);
 
        if (!node || !ast_xml_node_get_children(node)) {
-               ast_log(LOG_DEBUG, "Cannot find variable '%s' in tree '%s'\n", var, name);
                return ret;
        }