aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-19 16:23:45 +0000
committermogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-19 16:23:45 +0000
commitd5df46a93ee535f46c6e21dda422fa993620274d (patch)
treea58a9222645e8ccbba65497c74d4df0ef7353d54
parenta4b9dfccb4fc717972e6759a53d78a47babacf91 (diff)
similar patch for verbose vs debug with minor changes
bug 2617 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43272 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_dial.c2
-rw-r--r--apps/app_macro.c4
-rw-r--r--apps/app_queue.c2
-rw-r--r--channels/chan_sip.c2
-rw-r--r--main/asterisk.c2
-rw-r--r--main/config.c10
-rw-r--r--main/pbx.c11
-rw-r--r--pbx/pbx_gtkconsole.c2
8 files changed, 18 insertions, 17 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index f0d954d14..ec8eb6410 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -1182,7 +1182,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
/* Again, keep going even if there's an error */
if (option_debug)
ast_log(LOG_DEBUG, "ast call on peer returned %d\n", res);
- else if (option_verbose > 2)
+ if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Couldn't call %s\n", numsubst);
ast_hangup(tmp->chan);
tmp->chan = NULL;
diff --git a/apps/app_macro.c b/apps/app_macro.c
index 21c2b7c62..42b32dd83 100644
--- a/apps/app_macro.c
+++ b/apps/app_macro.c
@@ -238,14 +238,14 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
case AST_PBX_KEEPALIVE:
if (option_debug)
ast_log(LOG_DEBUG, "Spawn extension (%s,%s,%d) exited KEEPALIVE in macro %s on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
- else if (option_verbose > 1)
+ if (option_verbose > 1)
ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited KEEPALIVE in macro '%s' on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
goto out;
break;
default:
if (option_debug)
ast_log(LOG_DEBUG, "Spawn extension (%s,%s,%d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
- else if (option_verbose > 1)
+ if (option_verbose > 1)
ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
dead = 1;
goto out;
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 4726257f4..9cb24d94d 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -1636,7 +1636,7 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies
/* Again, keep going even if there's an error */
if (option_debug)
ast_log(LOG_DEBUG, "ast call on peer returned %d\n", res);
- else if (option_verbose > 2)
+ if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Couldn't call %s\n", tmp->interface);
do_hang(tmp);
(*busies)++;
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 479eeb22d..24dc53f65 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -7918,7 +7918,7 @@ static int cb_extensionstate(char *context, char* exten, int state, void *data)
}
transmit_state_notify(p, state, 1);
- if (option_debug > 1)
+ if (option_verbose > 1)
ast_verbose(VERBOSE_PREFIX_1 "Extension Changed %s new state %s for Notify User %s\n", exten, ast_extension_state2str(state), p->username);
return 0;
}
diff --git a/main/asterisk.c b/main/asterisk.c
index e981a7677..2010c727f 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -1185,7 +1185,7 @@ static void quit_handler(int num, int nice, int safeshutdown, int restart)
/* Called on exit */
if (option_verbose && ast_opt_console)
ast_verbose("Asterisk %s ending (%d).\n", ast_active_channels() ? "uncleanly" : "cleanly", num);
- else if (option_debug)
+ if (option_debug)
ast_log(LOG_DEBUG, "Asterisk ending (%d).\n", num);
manager_event(EVENT_FLAG_SYSTEM, "Shutdown", "Shutdown: %s\r\nRestart: %s\r\n", ast_active_channels() ? "Uncleanly" : "Cleanly", restart ? "True" : "False");
if (ast_socket > -1) {
diff --git a/main/config.c b/main/config.c
index ffd58b52b..9f7cfd4dc 100644
--- a/main/config.c
+++ b/main/config.c
@@ -717,21 +717,21 @@ static struct ast_config *config_text_file_load(const char *database, const char
ast_log(LOG_WARNING, "'%s' is not a regular file, ignoring\n", fn);
continue;
}
- if ((option_verbose > 1) && !option_debug) {
+ if (option_verbose > 1) {
ast_verbose(VERBOSE_PREFIX_2 "Parsing '%s': ", fn);
fflush(stdout);
}
if (!(f = fopen(fn, "r"))) {
if (option_debug)
ast_log(LOG_DEBUG, "No file to parse: %s\n", fn);
- else if (option_verbose > 1)
+ if (option_verbose > 1)
ast_verbose( "Not found (%s)\n", strerror(errno));
continue;
}
count++;
if (option_debug)
ast_log(LOG_DEBUG, "Parsing %s\n", fn);
- else if (option_verbose > 1)
+ if (option_verbose > 1)
ast_verbose("Found\n");
while(!feof(f)) {
lineno++;
@@ -835,7 +835,7 @@ int config_text_file_save(const char *configfile, const struct ast_config *cfg,
#else
if ((f = fopen(fn, "w"))) {
#endif
- if ((option_verbose > 1) && !option_debug)
+ if (option_verbose > 1)
ast_verbose( VERBOSE_PREFIX_2 "Saving '%s': ", fn);
fprintf(f, ";!\n");
fprintf(f, ";! Automatically generated configuration file\n");
@@ -872,7 +872,7 @@ int config_text_file_save(const char *configfile, const struct ast_config *cfg,
} else {
if (option_debug)
printf("Unable to open for writing: %s\n", fn);
- else if (option_verbose > 1)
+ if (option_verbose > 1)
printf( "Unable to write (%s)", strerror(errno));
return -1;
}
diff --git a/main/pbx.c b/main/pbx.c
index 977a284f1..5960df481 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -2354,14 +2354,14 @@ static int __ast_pbx_run(struct ast_channel *c)
if (res == AST_PBX_KEEPALIVE) {
if (option_debug)
ast_log(LOG_DEBUG, "Spawn extension (%s,%s,%d) exited KEEPALIVE on '%s'\n", c->context, c->exten, c->priority, c->name);
- else if (option_verbose > 1)
+ if (option_verbose > 1)
ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited KEEPALIVE on '%s'\n", c->context, c->exten, c->priority, c->name);
error = 1;
break;
}
if (option_debug)
ast_log(LOG_DEBUG, "Spawn extension (%s,%s,%d) exited non-zero on '%s'\n", c->context, c->exten, c->priority, c->name);
- else if (option_verbose > 1)
+ if (option_verbose > 1)
ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited non-zero on '%s'\n", c->context, c->exten, c->priority, c->name);
if (c->_softhangup == AST_SOFTHANGUP_ASYNCGOTO) {
c->_softhangup =0;
@@ -2481,7 +2481,7 @@ static int __ast_pbx_run(struct ast_channel *c)
/* Something bad happened, or a hangup has been requested. */
if (option_debug)
ast_log(LOG_DEBUG, "Spawn extension (%s,%s,%d) exited non-zero on '%s'\n", c->context, c->exten, c->priority, c->name);
- else if (option_verbose > 1)
+ if (option_verbose > 1)
ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited non-zero on '%s'\n", c->context, c->exten, c->priority, c->name);
break;
}
@@ -3822,7 +3822,7 @@ static struct ast_context *__ast_context_create(struct ast_context **extcontexts
*local_contexts = tmp;
if (option_debug)
ast_log(LOG_DEBUG, "Registered context '%s'\n", tmp->name);
- else if (option_verbose > 2)
+ if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "Registered extension context '%s'\n", tmp->name);
}
@@ -4796,7 +4796,8 @@ int ast_add_extension2(struct ast_context *con,
ast_log(LOG_DEBUG, "Added extension '%s' priority %d to %s\n",
tmp->exten, tmp->priority, con->name);
}
- } else if (option_verbose > 2) {
+ }
+ if (option_verbose > 2) {
if (tmp->matchcid) {
ast_verbose( VERBOSE_PREFIX_3 "Added extension '%s' priority %d (CID match '%s')to %s\n",
tmp->exten, tmp->priority, tmp->cidmatch, con->name);
diff --git a/pbx/pbx_gtkconsole.c b/pbx/pbx_gtkconsole.c
index 9f9a1899e..4dce4d28a 100644
--- a/pbx/pbx_gtkconsole.c
+++ b/pbx/pbx_gtkconsole.c
@@ -495,7 +495,7 @@ static int load_module(void *mod)
} else {
if (option_debug)
ast_log(LOG_DEBUG, "Unable to start GTK console monitor -- ignoring\n");
- else if (option_verbose > 1)
+ if (option_verbose > 1)
ast_verbose( VERBOSE_PREFIX_2 "GTK is not available -- skipping monitor\n");
}
return 0;