summaryrefslogtreecommitdiffstats
path: root/obj.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-03-05 14:53:25 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-03-05 14:53:25 +0000
commit24b02dc831889986211600a75572737e733ef9d8 (patch)
tree50e1525e5749c8b6e51969d8ff88060a172b0497 /obj.c
parent213e0b596205626214891fb46e1a780af7f26a8b (diff)
downloadrsyslog-24b02dc831889986211600a75572737e733ef9d8.tar.gz
rsyslog-24b02dc831889986211600a75572737e733ef9d8.tar.xz
rsyslog-24b02dc831889986211600a75572737e733ef9d8.zip
- extracted logerror*() family of functions from syslogd, made them their
own class and converted to new object calling conventions (interface-based) - converted gss-misc into a loadable library module
Diffstat (limited to 'obj.c')
-rw-r--r--obj.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/obj.c b/obj.c
index 9d886450..b648a4e4 100644
--- a/obj.c
+++ b/obj.c
@@ -84,11 +84,13 @@
#include "obj.h"
#include "stream.h"
#include "modules.h"
+#include "errmsg.h"
/* static data */
DEFobjCurrIf(obj) /* we define our own interface, as this is expected by some macros! */
DEFobjCurrIf(var)
DEFobjCurrIf(module)
+DEFobjCurrIf(errmsg)
static objInfo_t *arrObjInfo[OBJ_NUM_IDS]; /* array with object information pointers */
@@ -1036,7 +1038,8 @@ RegisterObj(uchar *pszObjName, objInfo_t *pInfo)
finalize_it:
if(iRet != RS_RET_OK) {
- logerrorVar("registering object '%s' failed with error code %d", pszObjName, iRet);
+RUNLOG_VAR("%p", errmsg.LogError);
+ errmsg.LogError(NO_ERRCODE, "registering object '%s' failed with error code %d", pszObjName, iRet);
}
RETiRet;
@@ -1154,10 +1157,16 @@ objClassInit(void)
CHKiRet(objGetObjInterface(&obj)); /* get ourselves ;) */
/* init classes we use (limit to as few as possible!) */
+RUNLOG_VAR("%p", errmsg.LogError);
+ CHKiRet(errmsgClassInit());
+ CHKiRet(cfsyslineInit());
CHKiRet(varClassInit());
CHKiRet(moduleClassInit());
CHKiRet(objUse(var, CORE_COMPONENT));
CHKiRet(objUse(module, CORE_COMPONENT));
+RUNLOG_VAR("%p", errmsg.LogError);
+ CHKiRet(objUse(errmsg, CORE_COMPONENT));
+RUNLOG_VAR("%p", errmsg.LogError);
finalize_it:
RETiRet;