Kaydet (Commit) 403c7729 authored tarafından Michael Stahl's avatar Michael Stahl

sax: allow some debug logging in FastParser

Multi-threading makes this difficult; have it print synchronously
where it is in the input when setting:
SAL_LOG="+INFO.sax.fastparser+WARN" SAX_DISABLE_THREADS=1

Change-Id: I8c77974acb2b4d4e273fc9c0f273c345d8feb2ff
üst 88c84e71
...@@ -421,6 +421,7 @@ certain functionality. ...@@ -421,6 +421,7 @@ certain functionality.
@section sax @section sax
@li @c sax.cppunit @li @c sax.cppunit
@li @c sax.fastparser
@section stoc @section stoc
......
...@@ -8,3 +8,6 @@ UNO services for SAX parsing and C++ functions for XMLSchema-2 data types. ...@@ -8,3 +8,6 @@ UNO services for SAX parsing and C++ functions for XMLSchema-2 data types.
+ C++ wrapper for fast SAX parser + C++ wrapper for fast SAX parser
+ C++ XMLSchema-2 data type conversion helpers + C++ XMLSchema-2 data type conversion helpers
Multi-threading in FastParser can be disabled for debugging purposes with:
SAX_DISABLE_THREADS=1 SAL_LOG="+INFO.sax.fastparser+WARN"
...@@ -759,7 +759,8 @@ void FastSaxParserImpl::parseStream(const InputSource& maStructSource) ...@@ -759,7 +759,8 @@ void FastSaxParserImpl::parseStream(const InputSource& maStructSource)
rEntity.mxDocumentHandler->startDocument(); rEntity.mxDocumentHandler->startDocument();
} }
rEntity.mbEnableThreads = (rEntity.maStructSource.aInputStream->available() > 10000); rEntity.mbEnableThreads = rEntity.maStructSource.aInputStream->available() > 10000
&& !getenv("SAX_DISABLE_THREADS");
if (rEntity.mbEnableThreads) if (rEntity.mbEnableThreads)
{ {
...@@ -1199,8 +1200,11 @@ void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xm ...@@ -1199,8 +1200,11 @@ void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xm
if (rEntity.mbEnableThreads) if (rEntity.mbEnableThreads)
produce(); produce();
else else
{
SAL_INFO("sax.fastparser", " startElement line " << mxDocumentLocator->getLineNumber() << " column " << mxDocumentLocator->getColumnNumber() << " " << prefix << ":" << localName);
rEntity.startElement( &rEvent ); rEntity.startElement( &rEvent );
} }
}
catch (const Exception&) catch (const Exception&)
{ {
rEntity.saveException( ::cppu::getCaughtException() ); rEntity.saveException( ::cppu::getCaughtException() );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment