From f8483a0d04f73e9d4c4f665efd5397cf96b17510 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Thu, 26 Jul 2007 15:49:18 +0000 Subject: Do a massive conversion for using the ast_verb() macro (closes issue #10277, patches by mvanbaak) Basically, this changes ... if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3, "Something\n"); to ... ast_verb(3, "Something\n"); git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77299 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- pbx/pbx_dundi.c | 9 ++------- pbx/pbx_gtkconsole.c | 10 ++++------ pbx/pbx_realtime.c | 3 +-- pbx/pbx_spool.c | 6 ++---- 4 files changed, 9 insertions(+), 19 deletions(-) (limited to 'pbx') diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c index 9f0df3a81..b37c4ed29 100644 --- a/pbx/pbx_dundi.c +++ b/pbx/pbx_dundi.c @@ -1634,11 +1634,9 @@ static int handle_command_response(struct dundi_transaction *trans, struct dundi ntohs(trans->addr.sin_port), expire); ast_db_put("dundi/dpeers", dundi_eid_to_str_short(eid_str, sizeof(eid_str), &peer->eid), data); if (inaddrcmp(&peer->addr, &trans->addr)) { - if (option_verbose > 2) { - ast_verbose(VERBOSE_PREFIX_3 "Registered DUNDi peer '%s' at '%s:%d'\n", + ast_verb(3, "Registered DUNDi peer '%s' at '%s:%d'\n", dundi_eid_to_str(eid_str, sizeof(eid_str), &peer->eid), ast_inet_ntoa(trans->addr.sin_addr), ntohs(trans->addr.sin_port)); - } needqual = 1; } @@ -4796,10 +4794,7 @@ static int load_module(void) ast_custom_function_register(&dundi_query_function); ast_custom_function_register(&dundi_result_function); - if (option_verbose > 1) { - ast_verbose(VERBOSE_PREFIX_2 "DUNDi Ready and Listening on %s port %d\n", - ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port)); - } + ast_verb(2, "DUNDi Ready and Listening on %s port %d\n", ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port)); return AST_MODULE_LOAD_SUCCESS; } diff --git a/pbx/pbx_gtkconsole.c b/pbx/pbx_gtkconsole.c index 9f9a1899e..e1cb6dc5a 100644 --- a/pbx/pbx_gtkconsole.c +++ b/pbx/pbx_gtkconsole.c @@ -313,8 +313,7 @@ static void exit_now(GtkWidget *widget, gpointer data) ast_update_use_count(); ast_unregister_verbose(verboser); ast_unload_resource("pbx_gtkconsole", 0); - if (option_verbose > 1) - ast_verbose(VERBOSE_PREFIX_2 "GTK Console Monitor Exiting\n"); + ast_verb(2, "GTK Console Monitor Exiting\n"); /* XXX Trying to quit after calling this makes asterisk segfault XXX */ } @@ -488,15 +487,14 @@ static int load_module(void *mod) if (!show_console()) { inuse++; ast_update_use_count(); - if (option_verbose > 1) - ast_verbose( VERBOSE_PREFIX_2 "Launched GTK Console monitor\n"); + ast_verb(2, "Launched GTK Console monitor\n"); } else ast_log(LOG_WARNING, "Unable to start GTK console\n"); } else { if (option_debug) ast_log(LOG_DEBUG, "Unable to start GTK console monitor -- ignoring\n"); - else if (option_verbose > 1) - ast_verbose( VERBOSE_PREFIX_2 "GTK is not available -- skipping monitor\n"); + else + ast_verb(2, "GTK is not available -- skipping monitor\n"); } return 0; } diff --git a/pbx/pbx_realtime.c b/pbx/pbx_realtime.c index d1011fe8e..107379851 100644 --- a/pbx/pbx_realtime.c +++ b/pbx/pbx_realtime.c @@ -198,8 +198,7 @@ static int realtime_exec(struct ast_channel *chan, const char *context, const ch if(!ast_strlen_zero(tmp)) pbx_substitute_variables_helper(chan, tmp, appdata, sizeof(appdata) - 1); - if (option_verbose > 2) - ast_verbose( VERBOSE_PREFIX_3 "Executing %s(\"%s\", \"%s\")\n", + ast_verb(3, "Executing %s(\"%s\", \"%s\")\n", term_color(tmp1, app, COLOR_BRCYAN, 0, sizeof(tmp1)), term_color(tmp2, chan->name, COLOR_BRMAGENTA, 0, sizeof(tmp2)), term_color(tmp3, S_OR(appdata, ""), COLOR_BRMAGENTA, 0, sizeof(tmp3))); diff --git a/pbx/pbx_spool.c b/pbx/pbx_spool.c index 00e97e4db..e5ccddb47 100644 --- a/pbx/pbx_spool.c +++ b/pbx/pbx_spool.c @@ -329,12 +329,10 @@ static void *attempt_thread(void *data) struct outgoing *o = data; int res, reason; if (!ast_strlen_zero(o->app)) { - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "Attempting call on %s/%s for application %s(%s) (Retry %d)\n", o->tech, o->dest, o->app, o->data, o->retries); + ast_verb(3, "Attempting call on %s/%s for application %s(%s) (Retry %d)\n", o->tech, o->dest, o->app, o->data, o->retries); res = ast_pbx_outgoing_app(o->tech, AST_FORMAT_SLINEAR, o->dest, o->waittime * 1000, o->app, o->data, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL); } else { - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "Attempting call on %s/%s for %s@%s:%d (Retry %d)\n", o->tech, o->dest, o->exten, o->context,o->priority, o->retries); + ast_verb(3, "Attempting call on %s/%s for %s@%s:%d (Retry %d)\n", o->tech, o->dest, o->exten, o->context,o->priority, o->retries); res = ast_pbx_outgoing_exten(o->tech, AST_FORMAT_SLINEAR, o->dest, o->waittime * 1000, o->context, o->exten, o->priority, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL); } if (res) { -- cgit v1.2.3