summaryrefslogtreecommitdiffstats
path: root/runtime/errmsg.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-04-17 12:46:57 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-04-17 12:46:57 +0200
commit60309004dfc57c3243abb2f01042950201596773 (patch)
tree707b9fbe0e4cc00133611701af0999c1bdacfbfc /runtime/errmsg.c
parente5130affc022eff12a3d9584576a385edbb13465 (diff)
downloadrsyslog-60309004dfc57c3243abb2f01042950201596773.tar.gz
rsyslog-60309004dfc57c3243abb2f01042950201596773.tar.xz
rsyslog-60309004dfc57c3243abb2f01042950201596773.zip
completed better modularity of runtime
- added the ability to specify an error log function for the runtime - removed dependency of core runtime on dirty.h Note that it is "better" modularity, not perfect. There is still work to do, but I think we can for the time being proceed with other things.
Diffstat (limited to 'runtime/errmsg.c')
-rw-r--r--runtime/errmsg.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/runtime/errmsg.c b/runtime/errmsg.c
index b555d06a..1744c902 100644
--- a/runtime/errmsg.c
+++ b/runtime/errmsg.c
@@ -33,7 +33,6 @@
#include <assert.h>
#include "rsyslog.h"
-#include "dirty.h"
#include "obj.h"
#include "errmsg.h"
#include "sysvar.h"
@@ -84,14 +83,7 @@ LogError(int __attribute__((unused)) iErrCode, char *fmt, ... )
msg[sizeof(msg)/sizeof(char) - 1] = '\0'; /* just to be on the safe side... */
errno = 0;
- /* we must check if the runtime is initialized, because else we can NOT
- * submit internal errors. -- rgerhards, 2008-04-16
- * TODO: a better way is to set an error handler and check if it is NULL
- */
- if(rsrtIsInit())
- logmsgInternal(LOG_SYSLOG|LOG_ERR, msg, ADDDATE);
- else
- fprintf(stderr, "rsyslog runtime error: %s\n", msg);
+ glblErrLogger((uchar*)msg);
ENDfunc
}
@@ -126,5 +118,12 @@ BEGINAbstractObjClassInit(errmsg, 1, OBJ_IS_CORE_MODULE) /* class, version */
/* set our own handlers */
ENDObjClassInit(errmsg)
+/* Exit the class.
+ * rgerhards, 2008-04-17
+ */
+BEGINObjClassExit(errmsg, OBJ_IS_CORE_MODULE) /* class, version */
+ /* release objects we no longer need */
+ENDObjClassExit(errmsg)
+
/* vi:set ai:
*/