aboutsummaryrefslogtreecommitdiffstats
path: root/main/cdr.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-14 19:39:12 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-14 19:39:12 +0000
commitf0424318479863edeed2a6a128e6d1ac926966e3 (patch)
tree4fd144260e58c9a66d331fc81b46473723452479 /main/cdr.c
parentc8ca7d2f263f5161ce1b29ec2c9de835131fc950 (diff)
Add a massive set of changes for converting to use the ast_debug() macro.
(issue #9957, patches from mvanbaak, caio1982, critch, and dimas) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@69327 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/cdr.c')
-rw-r--r--main/cdr.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/main/cdr.c b/main/cdr.c
index 76b5cfc1c..6614604eb 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -1049,16 +1049,14 @@ void ast_cdr_submit_batch(int shutdown)
/* if configured, spawn a new thread to post these CDRs,
also try to save as much as possible if we are shutting down safely */
if (batchscheduleronly || shutdown) {
- if (option_debug)
- ast_log(LOG_DEBUG, "CDR single-threaded batch processing begins now\n");
+ ast_debug(1, "CDR single-threaded batch processing begins now\n");
do_batch_backend_process(oldbatchitems);
} else {
if (ast_pthread_create_detached_background(&batch_post_thread, NULL, do_batch_backend_process, oldbatchitems)) {
ast_log(LOG_WARNING, "CDR processing thread could not detach, now trying in this thread\n");
do_batch_backend_process(oldbatchitems);
} else {
- if (option_debug)
- ast_log(LOG_DEBUG, "CDR multi-threaded batch processing begins now\n");
+ ast_debug(1, "CDR multi-threaded batch processing begins now\n");
}
}
}
@@ -1095,8 +1093,7 @@ void ast_cdr_detach(struct ast_cdr *cdr)
/* maybe they disabled CDR stuff completely, so just drop it */
if (!enabled) {
- if (option_debug)
- ast_log(LOG_DEBUG, "Dropping CDR !\n");
+ ast_debug(1, "Dropping CDR !\n");
ast_set_flag(cdr, AST_CDR_FLAG_POST_DISABLED);
ast_cdr_free(cdr);
return;
@@ -1110,8 +1107,7 @@ void ast_cdr_detach(struct ast_cdr *cdr)
}
/* otherwise, each CDR gets put into a batch list (at the end) */
- if (option_debug)
- ast_log(LOG_DEBUG, "CDR detaching from this thread\n");
+ ast_debug(1, "CDR detaching from this thread\n");
/* we'll need a new tail for every CDR */
if (!(newtail = ast_calloc(1, sizeof(*newtail)))) {
@@ -1161,8 +1157,7 @@ static void *do_cdr(void *data)
ast_cond_timedwait(&cdr_pending_cond, &cdr_pending_lock, &timeout);
numevents = ast_sched_runq(sched);
ast_mutex_unlock(&cdr_pending_lock);
- if (option_debug > 1)
- ast_log(LOG_DEBUG, "Processed %d scheduled CDR batches from the run queue\n", numevents);
+ ast_debug(2, "Processed %d scheduled CDR batches from the run queue\n", numevents);
}
return NULL;