diff --git a/src/event.c b/src/event.c index 9174272f..f69287e8 100644 --- a/src/event.c +++ b/src/event.c @@ -35,6 +35,7 @@ void event_config_read(void *arg) config = config_grab_config(); /* Both to get the lock, and to be able to find out the config filename */ + xmlSetGenericErrorFunc ("config", log_parse_failure); ret = config_parse_file(config->config_filename, &new_config); if(ret < 0) { ERROR0("Error parsing config, not replacing existing config"); diff --git a/src/logging.c b/src/logging.c index aea92b23..0ab09051 100644 --- a/src/logging.c +++ b/src/logging.c @@ -188,6 +188,20 @@ void logging_playlist(const char *mount, const char *metadata, long listeners) } +void log_parse_failure (void *ctx, const char *fmt, ...) +{ + char line [200]; + va_list ap; + char *eol; + + va_start (ap, fmt); + vsnprintf (line, sizeof (line), fmt, ap); + eol = strrchr (line, '\n'); + if (eol) *eol='\0'; + va_end (ap); + log_write (errorlog, 2, (char*)ctx, "", "%s", line); +} + void restart_logging (ice_config_t *config) { diff --git a/src/logging.h b/src/logging.h index fcf6b856..4a8df6c0 100644 --- a/src/logging.h +++ b/src/logging.h @@ -95,6 +95,7 @@ extern int playlistlog; void logging_access(client_t *client); void logging_playlist(const char *mount, const char *metadata, long listeners); void restart_logging (ice_config_t *config); +void log_parse_failure (void *ctx, const char *fmt, ...); #endif /* __LOGGING_H__ */ diff --git a/src/xslt.c b/src/xslt.c index c763a97e..4dcfecb7 100644 --- a/src/xslt.c +++ b/src/xslt.c @@ -190,6 +190,9 @@ void xslt_transform(xmlDocPtr doc, const char *xslfilename, client_t *client) xmlChar *string; int len, problem = 0; + xmlSetGenericErrorFunc ("", log_parse_failure); + xsltSetGenericErrorFunc ("", log_parse_failure); + thread_mutex_lock(&xsltlock); cur = xslt_get_stylesheet(xslfilename);