Revert changes to extconf.c

It seems extconf.c already defines some local ast_debug() functions.  Theses
should be removed and replaced with logger.h.  A patch will be added to
reviewboard shortly.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306292 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Paul Belanger
2011-02-04 18:16:16 +00:00
parent 3556e4c2d4
commit ed3a4856aa

View File

@@ -3761,13 +3761,15 @@ static struct ast_config *config_text_file_load(const char *database, const char
fflush(stdout); fflush(stdout);
} }
if (!(f = fopen(fn, "r"))) { if (!(f = fopen(fn, "r"))) {
ast_debug(1, "No file to parse: %s\n", fn); if (option_debug)
ast_log(LOG_DEBUG, "No file to parse: %s\n", fn);
if (option_verbose > 1) if (option_verbose > 1)
ast_verbose( "Not found (%s)\n", strerror(errno)); ast_verbose( "Not found (%s)\n", strerror(errno));
continue; continue;
} }
count++; count++;
ast_debug(1, "Parsing %s\n", fn); if (option_debug)
ast_log(LOG_DEBUG, "Parsing %s\n", fn);
if (option_verbose > 1) if (option_verbose > 1)
ast_verbose("Found\n"); ast_verbose("Found\n");
while(!feof(f)) { while(!feof(f)) {
@@ -4155,6 +4157,8 @@ int localized_config_text_file_save(const char *configfile, const struct ast_con
} }
fclose(f); fclose(f);
var = var->next; var = var->next;
} }
cat = cat->next; cat = cat->next;
@@ -4162,7 +4166,8 @@ int localized_config_text_file_save(const char *configfile, const struct ast_con
if ((option_verbose > 1) && !option_debug) if ((option_verbose > 1) && !option_debug)
ast_verbose("Saved\n"); ast_verbose("Saved\n");
} else { } else {
ast_debug(1, "Unable to open for writing: %s\n", fn); if (option_debug)
ast_log(LOG_DEBUG, "Unable to open for writing: %s\n", fn);
if (option_verbose > 1) if (option_verbose > 1)
ast_verbose(VERBOSE_PREFIX_2 "Unable to write (%s)", strerror(errno)); ast_verbose(VERBOSE_PREFIX_2 "Unable to write (%s)", strerror(errno));
return -1; return -1;
@@ -4272,12 +4277,14 @@ static int ast_add_hint(struct ast_exten *e)
/* Search if hint exists, do nothing */ /* Search if hint exists, do nothing */
AST_RWLIST_TRAVERSE(&hints, hint, list) { AST_RWLIST_TRAVERSE(&hints, hint, list) {
if (hint->exten == e) { if (hint->exten == e) {
ast_debug(2, "HINTS: Not re-adding existing hint %s: %s\n", ast_get_extension_name(e), ast_get_extension_app(e)); if (option_debug > 1)
ast_log(LOG_DEBUG, "HINTS: Not re-adding existing hint %s: %s\n", ast_get_extension_name(e), ast_get_extension_app(e));
return -1; return -1;
} }
} }
ast_debug(2, "HINTS: Adding hint %s: %s\n", ast_get_extension_name(e), ast_get_extension_app(e)); if (option_debug > 1)
ast_log(LOG_DEBUG, "HINTS: Adding hint %s: %s\n", ast_get_extension_name(e), ast_get_extension_app(e));
if (!(hint = ast_calloc(1, sizeof(*hint)))) { if (!(hint = ast_calloc(1, sizeof(*hint)))) {
return -1; return -1;
@@ -5316,7 +5323,8 @@ static struct ast_context *__ast_context_create(struct ast_context **extcontexts
tmp->includes = NULL; tmp->includes = NULL;
tmp->ignorepats = NULL; tmp->ignorepats = NULL;
*loc_contexts = tmp; *loc_contexts = tmp;
ast_debug(1, "Registered context '%s'\n", tmp->name); if (option_debug)
ast_log(LOG_DEBUG, "Registered context '%s'\n", tmp->name);
if (option_verbose > 2) if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "Registered extension context '%s'\n", tmp->name); ast_verbose( VERBOSE_PREFIX_3 "Registered extension context '%s'\n", tmp->name);
} }
@@ -5449,10 +5457,10 @@ static int ast_add_extension2(struct ast_context *con,
} }
if (option_debug) { if (option_debug) {
if (tmp->matchcid) { if (tmp->matchcid) {
ast_debug(1, "Added extension '%s' priority %d (CID match '%s') to %s\n", ast_log(LOG_DEBUG, "Added extension '%s' priority %d (CID match '%s') to %s\n",
tmp->exten, tmp->priority, tmp->cidmatch, con->name); tmp->exten, tmp->priority, tmp->cidmatch, con->name);
} else { } else {
ast_debug(1, "Added extension '%s' priority %d to %s\n", ast_log(LOG_DEBUG, "Added extension '%s' priority %d to %s\n",
tmp->exten, tmp->priority, con->name); tmp->exten, tmp->priority, con->name);
} }
} }
@@ -5543,7 +5551,8 @@ static int pbx_extension_helper(struct ast_channel *c, struct ast_context *con,
ast_log(LOG_NOTICE, "No such label '%s' in extension '%s' in context '%s'\n", label, exten, context); ast_log(LOG_NOTICE, "No such label '%s' in extension '%s' in context '%s'\n", label, exten, context);
break; break;
default: default:
ast_debug(1, "Shouldn't happen!\n"); if (option_debug)
ast_log(LOG_DEBUG, "Shouldn't happen!\n");
} }
return (matching_action) ? 0 : -1; return (matching_action) ? 0 : -1;
@@ -5825,7 +5834,8 @@ static void pbx_substitute_variables_helper_full(struct ast_channel *c, struct v
if (isfunction) { if (isfunction) {
/* Evaluate function */ /* Evaluate function */
cp4 = ast_func_read(c, vars, workspace, VAR_BUF_SIZE) ? NULL : workspace; cp4 = ast_func_read(c, vars, workspace, VAR_BUF_SIZE) ? NULL : workspace;
ast_debug(1, "Function result is '%s'\n", cp4 ? cp4 : "(null)"); if (option_debug)
ast_log(LOG_DEBUG, "Function result is '%s'\n", cp4 ? cp4 : "(null)");
} else { } else {
/* Retrieve variable value */ /* Retrieve variable value */
pbx_retrieve_variable(c, vars, &cp4, workspace, VAR_BUF_SIZE, headp); pbx_retrieve_variable(c, vars, &cp4, workspace, VAR_BUF_SIZE, headp);
@@ -5893,7 +5903,8 @@ static void pbx_substitute_variables_helper_full(struct ast_channel *c, struct v
length = ast_expr(vars, cp2, count, NULL); length = ast_expr(vars, cp2, count, NULL);
if (length) { if (length) {
ast_debug(1, "Expression result is '%s'\n", cp2); if (option_debug)
ast_log(LOG_DEBUG, "Expression result is '%s'\n", cp2);
count -= length; count -= length;
cp2 += length; cp2 += length;
*cp2 = 0; *cp2 = 0;
@@ -6087,7 +6098,8 @@ static void __ast_context_destroy(struct ast_context *con, const char *registrar
for (tmp = contexts; tmp; ) { for (tmp = contexts; tmp; ) {
struct ast_context *next; /* next starting point */ struct ast_context *next; /* next starting point */
for (; tmp; tmpl = tmp, tmp = tmp->next) { for (; tmp; tmpl = tmp, tmp = tmp->next) {
ast_debug(1, "check ctx %s %s\n", tmp->name, tmp->registrar); if (option_debug)
ast_log(LOG_DEBUG, "check ctx %s %s\n", tmp->name, tmp->registrar);
if ( (!registrar || !strcasecmp(registrar, tmp->registrar)) && if ( (!registrar || !strcasecmp(registrar, tmp->registrar)) &&
(!con || !strcasecmp(tmp->name, con->name)) ) (!con || !strcasecmp(tmp->name, con->name)) )
break; /* found it */ break; /* found it */
@@ -6095,7 +6107,8 @@ static void __ast_context_destroy(struct ast_context *con, const char *registrar
if (!tmp) /* not found, we are done */ if (!tmp) /* not found, we are done */
break; break;
ast_wrlock_context(tmp); ast_wrlock_context(tmp);
ast_debug(1, "delete ctx %s %s\n", tmp->name, tmp->registrar); if (option_debug)
ast_log(LOG_DEBUG, "delete ctx %s %s\n", tmp->name, tmp->registrar);
next = tmp->next; next = tmp->next;
if (tmpl) if (tmpl)
tmpl->next = next; tmpl->next = next;
@@ -6160,7 +6173,8 @@ static void ast_merge_contexts_and_delete(struct ast_context **extcontexts, cons
tmp = *extcontexts; tmp = *extcontexts;
if (registrar) { if (registrar) {
/* XXX remove previous contexts from same registrar */ /* XXX remove previous contexts from same registrar */
ast_debug(1, "must remove any reg %s\n", registrar); if (option_debug)
ast_log(LOG_DEBUG, "must remove any reg %s\n", registrar);
__ast_context_destroy(NULL,registrar); __ast_context_destroy(NULL,registrar);
while (tmp) { while (tmp) {
lasttmp = tmp; lasttmp = tmp;