summaryrefslogtreecommitdiffstats
path: root/plugins/ompgsql
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-03-06 09:44:16 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-03-06 09:44:16 +0000
commit15e8b33eedce5985701f0b8c949125999fcf789b (patch)
treef44a9af22478c5f8a31a347fb5b13b1ab47f8828 /plugins/ompgsql
parent680e899ce9bf84b2406620f4dc1a35986568c97a (diff)
downloadrsyslog-15e8b33eedce5985701f0b8c949125999fcf789b.tar.gz
rsyslog-15e8b33eedce5985701f0b8c949125999fcf789b.tar.xz
rsyslog-15e8b33eedce5985701f0b8c949125999fcf789b.zip
fixed a few remaining logerror() calls - thanks to Michael Biebl for
pointing that out
Diffstat (limited to 'plugins/ompgsql')
-rw-r--r--plugins/ompgsql/ompgsql.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/plugins/ompgsql/ompgsql.c b/plugins/ompgsql/ompgsql.c
index abe5ff13..9e84956a 100644
--- a/plugins/ompgsql/ompgsql.c
+++ b/plugins/ompgsql/ompgsql.c
@@ -42,12 +42,14 @@
#include "template.h"
#include "ompgsql.h"
#include "module-template.h"
+#include "errmsg.h"
MODULE_TYPE_OUTPUT
/* internal structures
*/
DEF_OMOD_STATIC_DATA
+DEFobjCurrIf(errmsg)
typedef struct _instanceData {
PGconn *f_hpgsql; /* handle to PgSQL */
@@ -116,7 +118,7 @@ static void reportDBError(instanceData *pData, int bSilent)
/* output log message */
errno = 0;
if(pData->f_hpgsql == NULL) {
- logerror("unknown DB error occured - could not obtain PgSQL handle");
+ errmsg.LogError(NO_ERRCODE, "unknown DB error occured - could not obtain PgSQL handle");
} else { /* we can ask pgsql for the error description... */
ePgSQLStatus = PQstatus(pData->f_hpgsql);
snprintf(errMsg, sizeof(errMsg)/sizeof(char), "db error (%d): %s\n", ePgSQLStatus,
@@ -125,7 +127,7 @@ static void reportDBError(instanceData *pData, int bSilent)
dbgprintf("pgsql, DBError(silent): %s\n", errMsg);
else {
pData->eLastPgSQLStatus = ePgSQLStatus;
- logerror(errMsg);
+ errmsg.LogError(NO_ERRCODE, "%s", errMsg);
}
}
@@ -153,7 +155,7 @@ static rsRetVal initPgSQL(instanceData *pData, int bSilent)
iRet = RS_RET_SUSPENDED;
}
- return iRet;
+ RETiRet;
}
@@ -189,7 +191,7 @@ finalize_it:
pData->eLastPgSQLStatus = CONNECTION_OK; /* reset error for error supression */
}
- return iRet;
+ RETiRet;
}
@@ -267,7 +269,7 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1)
* Retries make no sense.
*/
if (iPgSQLPropErr) {
- logerror("Trouble with PgSQL connection properties. -PgSQL logging disabled");
+ errmsg.LogError(NO_ERRCODE, "Trouble with PgSQL connection properties. -PgSQL logging disabled");
ABORT_FINALIZE(RS_RET_INVALID_PARAMS);
} else {
CHKiRet(initPgSQL(pData, 0));
@@ -291,6 +293,7 @@ BEGINmodInit()
CODESTARTmodInit
*ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */
CODEmodInit_QueryRegCFSLineHdlr
+ CHKiRet(objUse(errmsg, CORE_COMPONENT));
ENDmodInit
/*
* vi:set ai: