aboutsummaryrefslogtreecommitdiffstats
path: root/cdr
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 /cdr
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 'cdr')
-rw-r--r--cdr/cdr_csv.c9
-rw-r--r--cdr/cdr_odbc.c18
-rw-r--r--cdr/cdr_pgsql.c23
-rw-r--r--cdr/cdr_radius.c3
-rw-r--r--cdr/cdr_tds.c3
5 files changed, 21 insertions, 35 deletions
diff --git a/cdr/cdr_csv.c b/cdr/cdr_csv.c
index ffbfee27b..cbfe80fd0 100644
--- a/cdr/cdr_csv.c
+++ b/cdr/cdr_csv.c
@@ -122,8 +122,7 @@ static int load_config(void)
if (tmp) {
usegmtime = ast_true(tmp);
if (usegmtime) {
- if (option_debug)
- ast_log(LOG_DEBUG, "logging time in GMT\n");
+ ast_debug(1, "logging time in GMT\n");
}
}
@@ -131,8 +130,7 @@ static int load_config(void)
if (tmp) {
loguniqueid = ast_true(tmp);
if (loguniqueid) {
- if (option_debug)
- ast_log(LOG_DEBUG, "logging CDR field UNIQUEID\n");
+ ast_debug(1, "logging CDR field UNIQUEID\n");
}
}
@@ -140,8 +138,7 @@ static int load_config(void)
if (tmp) {
loguserfield = ast_true(tmp);
if (loguserfield) {
- if (option_debug)
- ast_log(LOG_DEBUG, "logging CDR user-defined field\n");
+ ast_debug(1, "logging CDR user-defined field\n");
}
}
diff --git a/cdr/cdr_odbc.c b/cdr/cdr_odbc.c
index 1a8b52143..56f0cda35 100644
--- a/cdr/cdr_odbc.c
+++ b/cdr/cdr_odbc.c
@@ -306,15 +306,12 @@ static int odbc_load_module(void)
if (tmp) {
loguniqueid = ast_true(tmp);
if (loguniqueid) {
- if (option_debug)
- ast_log(LOG_DEBUG,"cdr_odbc: Logging uniqueid\n");
+ ast_debug(1,"cdr_odbc: Logging uniqueid\n");
} else {
- if (option_debug)
- ast_log(LOG_DEBUG,"cdr_odbc: Not logging uniqueid\n");
+ ast_debug(1,"cdr_odbc: Not logging uniqueid\n");
}
} else {
- if (option_debug)
- ast_log(LOG_DEBUG,"cdr_odbc: Not logging uniqueid\n");
+ ast_debug(1,"cdr_odbc: Not logging uniqueid\n");
loguniqueid = 0;
}
@@ -322,15 +319,12 @@ static int odbc_load_module(void)
if (tmp) {
usegmtime = ast_true(tmp);
if (usegmtime) {
- if (option_debug)
- ast_log(LOG_DEBUG,"cdr_odbc: Logging in GMT\n");
+ ast_debug(1,"cdr_odbc: Logging in GMT\n");
} else {
- if (option_debug)
- ast_log(LOG_DEBUG,"cdr_odbc: Not logging in GMT\n");
+ ast_debug(1,"cdr_odbc: Not logging in GMT\n");
}
} else {
- if (option_debug)
- ast_log(LOG_DEBUG,"cdr_odbc: Not logging in GMT\n");
+ ast_debug(1,"cdr_odbc: Not logging in GMT\n");
usegmtime = 0;
}
diff --git a/cdr/cdr_pgsql.c b/cdr/cdr_pgsql.c
index d5ec87884..0b62440a8 100644
--- a/cdr/cdr_pgsql.c
+++ b/cdr/cdr_pgsql.c
@@ -121,8 +121,7 @@ static int pgsql_log(struct ast_cdr *cdr)
return -1;
}
- if (option_debug > 1)
- ast_log(LOG_DEBUG, "cdr_pgsql: inserting a CDR record.\n");
+ ast_debug(2, "cdr_pgsql: inserting a CDR record.\n");
snprintf(sqlcmd,sizeof(sqlcmd),"INSERT INTO %s (calldate,clid,src,dst,dcontext,channel,dstchannel,"
"lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid,userfield) VALUES"
@@ -130,8 +129,7 @@ static int pgsql_log(struct ast_cdr *cdr)
table,timestr,clid,cdr->src, cdr->dst, dcontext,channel, dstchannel, lastapp, lastdata,
cdr->duration,cdr->billsec,ast_cdr_disp2str(cdr->disposition),cdr->amaflags, cdr->accountcode, uniqueid, userfield);
- if (option_debug > 2)
- ast_log(LOG_DEBUG, "cdr_pgsql: SQL command executed: %s\n",sqlcmd);
+ ast_debug(3, "cdr_pgsql: SQL command executed: %s\n",sqlcmd);
/* Test to be sure we're still connected... */
/* If we're connected, and connection is working, good. */
@@ -259,20 +257,19 @@ static int process_my_load_module(struct ast_config *cfg)
if (option_debug) {
if (ast_strlen_zero(pghostname))
- ast_log(LOG_DEBUG, "cdr_pgsql: using default unix socket\n");
+ ast_debug(1, "cdr_pgsql: using default unix socket\n");
else
- ast_log(LOG_DEBUG, "cdr_pgsql: got hostname of %s\n", pghostname);
- ast_log(LOG_DEBUG, "cdr_pgsql: got port of %s\n", pgdbport);
- ast_log(LOG_DEBUG, "cdr_pgsql: got user of %s\n", pgdbuser);
- ast_log(LOG_DEBUG, "cdr_pgsql: got dbname of %s\n", pgdbname);
- ast_log(LOG_DEBUG, "cdr_pgsql: got password of %s\n", pgpassword);
- ast_log(LOG_DEBUG, "cdr_pgsql: got sql table name of %s\n", table);
+ ast_debug(1, "cdr_pgsql: got hostname of %s\n", pghostname);
+ ast_debug(1, "cdr_pgsql: got port of %s\n", pgdbport);
+ ast_debug(1, "cdr_pgsql: got user of %s\n", pgdbuser);
+ ast_debug(1, "cdr_pgsql: got dbname of %s\n", pgdbname);
+ ast_debug(1, "cdr_pgsql: got password of %s\n", pgpassword);
+ ast_debug(1, "cdr_pgsql: got sql table name of %s\n", table);
}
conn = PQsetdbLogin(pghostname, pgdbport, NULL, NULL, pgdbname, pgdbuser, pgpassword);
if (PQstatus(conn) != CONNECTION_BAD) {
- if (option_debug)
- ast_log(LOG_DEBUG, "Successfully connected to PostgreSQL database.\n");
+ ast_debug(1, "Successfully connected to PostgreSQL database.\n");
connected = 1;
} else {
pgerror = PQerrorMessage(conn);
diff --git a/cdr/cdr_radius.c b/cdr/cdr_radius.c
index 99968ed31..ff380a13a 100644
--- a/cdr/cdr_radius.c
+++ b/cdr/cdr_radius.c
@@ -218,8 +218,7 @@ static int radius_log(struct ast_cdr *cdr)
VALUE_PAIR *send = NULL;
if (build_radius_record(&send, cdr)) {
- if (option_debug)
- ast_log(LOG_DEBUG, "Unable to create RADIUS record. CDR not recorded!\n");
+ ast_debug(1, "Unable to create RADIUS record. CDR not recorded!\n");
return result;
}
diff --git a/cdr/cdr_tds.c b/cdr/cdr_tds.c
index 736199a4a..3f79fc637 100644
--- a/cdr/cdr_tds.c
+++ b/cdr/cdr_tds.c
@@ -482,8 +482,7 @@ static int tds_load_module(void)
ptr = ast_variable_retrieve(cfg,"global","table");
if (ptr == NULL) {
- if (option_debug)
- ast_log(LOG_DEBUG,"cdr_tds: table not specified. Assuming cdr\n");
+ ast_debug(1,"cdr_tds: table not specified. Assuming cdr\n");
ptr = "cdr";
}
table = strdup(ptr);