1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2008 Index Data
3 * See the file LICENSE for details.
7 \brief Log XML / XSLT Errors via yaz_log
14 #include <yaz/snprintf.h>
17 #include <libxml/parser.h>
18 #include <libxml/tree.h>
21 #include <libxslt/xsltutils.h>
24 static int xml_error_log_level = YLOG_WARN;
27 static void xml_error_handler(void *ctx, const char *fmt, ...)
30 const char *prefix = (const char *) ctx;
35 yaz_vsnprintf(buf, sizeof(buf), fmt, ap);
36 yaz_log(YLOG_WARN, "%s: %s", prefix, buf);
42 void yaz_log_xml_errors(const char *prefix, int log_level)
44 xml_error_log_level = log_level;
47 xmlSetGenericErrorFunc((void *) (prefix ? prefix : "XML"),
51 xsltSetGenericErrorFunc((void *) (prefix ? prefix : "XSLT"),
59 * indent-tabs-mode: nil
61 * vim: shiftwidth=4 tabstop=8 expandtab