aboutsummaryrefslogtreecommitdiff
path: root/src/sql.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-03-10 23:25:11 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2013-03-10 23:26:52 +0200
commit39a97e438dde837ada9a99cceea93a1cf97db19e (patch)
treeefc492dcfcdc2c21bfdec5c31692b348601cd94a /src/sql.c
parent87602f5492b842f734dffe22f4e2f85dbc6ce713 (diff)
downloadwydawca-39a97e438dde837ada9a99cceea93a1cf97db19e.tar.gz
wydawca-39a97e438dde837ada9a99cceea93a1cf97db19e.tar.bz2
Provide a convenient debugging macro.
Rename logmsg to wy_log.
Diffstat (limited to 'src/sql.c')
-rw-r--r--src/sql.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/sql.c b/src/sql.c
index 3f4da2e..4176e88 100644
--- a/src/sql.c
+++ b/src/sql.c
@@ -60,7 +60,7 @@ sql_init_dictionary(struct dictionary *dict)
struct sqlconn *conn = sql_find_connection(dict->parmv[0]);
if (!conn) {
- logmsg(LOG_EMERG,
+ wy_log(LOG_EMERG,
_("INTERNAL ERROR: cannot find SQL connection %s"),
dict->parmv[0]);
abort();
@@ -83,7 +83,7 @@ sql_init_dictionary(struct dictionary *dict)
conn->password, conn->database,
conn->port, conn->socket,
CLIENT_MULTI_RESULTS)) {
- logmsg(LOG_ERR,
+ wy_log(LOG_ERR,
_("failed to connect to database %s: "
"error: %s\n"),
dict->parmv[0], mysql_error(&conn->mysql));
@@ -134,30 +134,30 @@ sql_lookup_dictionary(struct dictionary *dict, void *handle, const char *query)
MYSQL *mysql = &conn->mysql;
if (!query) {
- logmsg(LOG_ERR, _("no query supplied for dictionary %s"),
+ wy_log(LOG_ERR, _("no query supplied for dictionary %s"),
"sql");
return 1;
}
if (mysql_query(mysql, query)) {
- logmsg(LOG_ERR, _("query failed: %s"), mysql_error(mysql));
- logmsg(LOG_NOTICE, _("the failed query was: %s"), query);
+ wy_log(LOG_ERR, _("query failed: %s"), mysql_error(mysql));
+ wy_log(LOG_NOTICE, _("the failed query was: %s"), query);
return 1;
}
conn->result = mysql_store_result(mysql);
if (!conn->result) {
- logmsg(LOG_ERR, _("cannot get result: %s"), mysql_error(mysql));
- logmsg(LOG_NOTICE, _("the failed query was: %s"), query);
+ wy_log(LOG_ERR, _("cannot get result: %s"), mysql_error(mysql));
+ wy_log(LOG_NOTICE, _("the failed query was: %s"), query);
return 1;
}
dict->nrow = mysql_num_rows(conn->result);
dict->ncol = mysql_num_fields(conn->result);
if (wy_debug_level > 1) {
- logmsg(LOG_DEBUG, _("query returned %u columns in %u rows"),
+ wy_log(LOG_DEBUG, _("query returned %u columns in %u rows"),
dict->ncol, dict->nrow);
- logmsg(LOG_DEBUG, _("the query was: %s"), query);
+ wy_log(LOG_DEBUG, _("the query was: %s"), query);
}
return 0;

Return to:

Send suggestions and report system problems to the System administrator.