summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/rsconf.c15
-rw-r--r--runtime/rsyslog.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/runtime/rsconf.c b/runtime/rsconf.c
index abce53b8..c855779e 100644
--- a/runtime/rsconf.c
+++ b/runtime/rsconf.c
@@ -292,6 +292,21 @@ finalize_it:
extern int yylineno;
void
+parser_warnmsg(char *fmt, ...)
+{
+ va_list ap;
+ char errBuf[1024];
+
+ va_start(ap, fmt);
+ if(vsnprintf(errBuf, sizeof(errBuf), fmt, ap) == sizeof(errBuf))
+ errBuf[sizeof(errBuf)-1] = '\0';
+ errmsg.LogError(0, RS_RET_CONF_PARSE_WARNING,
+ "warning during parsing file %s, on or before line %d: %s",
+ cnfcurrfn, yylineno, errBuf);
+ va_end(ap);
+}
+
+void
parser_errmsg(char *fmt, ...)
{
va_list ap;
diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h
index ae56f08f..e0331da7 100644
--- a/runtime/rsyslog.h
+++ b/runtime/rsyslog.h
@@ -382,6 +382,7 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth
RS_RET_ERR_UDPSEND = -2354,/**< sending msg via UDP failed */
RS_RET_LAST_ERRREPORT = -2355,/**< module does not emit more error messages as limit is reached */
RS_RET_READ_ERR = -2356,/**< read error occured (file i/o) */
+ RS_RET_CONF_PARSE_WARNING = -2357,/**< warning parsing config file */
/* RainerScript error messages (range 1000.. 1999) */
RS_RET_SYSVAR_NOT_FOUND = 1001, /**< system variable could not be found (maybe misspelled) */