VirtualBox

Changeset 65597 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Feb 3, 2017 11:40:44 AM (8 years ago)
Author:
vboxsync
Message:

Runtime: XML errors => LogRel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/xml.cpp

    r65008 r65597  
    3232#include <iprt/file.h>
    3333#include <iprt/err.h>
     34#include <iprt/log.h>
    3435#include <iprt/param.h>
    3536#include <iprt/path.h>
     
    17271728////////////////////////////////////////////////////////////////////////////////
    17281729
     1730static void xmlParserBaseGenericError(void *pCtx, const char *pszMsg, ...)
     1731{
     1732    NOREF(pCtx);
     1733    va_list args;
     1734    va_start(args, pszMsg);
     1735    RTLogRelPrintfV(pszMsg, args);
     1736    va_end(args);
     1737}
     1738
     1739static void xmlParserBaseStructuredError(void *pCtx, xmlErrorPtr error)
     1740{
     1741    NOREF(pCtx);
     1742    /* we expect that there is always a trailing NL */
     1743    LogRel(("XML error at '%s' line %d: %s", error->file, error->line, error->message));
     1744}
     1745
    17291746XmlParserBase::XmlParserBase()
    17301747{
     
    17321749    if (m_ctxt == NULL)
    17331750        throw std::bad_alloc();
     1751    /* per-thread so it must be here */
     1752    xmlSetGenericErrorFunc(NULL, xmlParserBaseGenericError);
     1753    xmlSetStructuredErrorFunc(NULL, xmlParserBaseStructuredError);
    17341754}
    17351755
    17361756XmlParserBase::~XmlParserBase()
    17371757{
     1758    xmlSetStructuredErrorFunc(NULL, NULL);
     1759    xmlSetGenericErrorFunc(NULL, NULL);
    17381760    xmlFreeParserCtxt (m_ctxt);
    17391761    m_ctxt = NULL;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette