Support --enable-debug-logs=no option of configure script (#2)

* Support --enable-debug-logs=no option of configure script

* Undo unintended white space changes

* Undo more unintended white space changes

* Address review comments - thanks Mirko

* Address more review comments - thanks Mirko
This commit is contained in:
michaelgranzow-avi
2017-08-03 19:50:43 +02:00
committed by Felipe Zimmerle
parent 1d3c4c670d
commit 3a048ee2db
22 changed files with 305 additions and 4 deletions

View File

@@ -70,7 +70,9 @@ bool XML::processChunk(const char *buf, unsigned int size,
if (m_data.parsing_ctx == NULL) {
/* First invocation. */
#ifndef NO_LOGS
debug(4, "XML: Initialising parser.");
#endif
/* NOTE When Sax interface is used libxml will not
* create the document object, but we need it.
@@ -89,7 +91,9 @@ bool XML::processChunk(const char *buf, unsigned int size,
buf, size, "body.xml");
if (m_data.parsing_ctx == NULL) {
#ifndef NO_LOGS
debug(4, "XML: Failed to create parsing context.");
#endif
error->assign("XML: Failed to create parsing context.");
return false;
}
@@ -100,7 +104,9 @@ bool XML::processChunk(const char *buf, unsigned int size,
xmlParseChunk(m_data.parsing_ctx, buf, size, 0);
if (m_data.parsing_ctx->wellFormed != 1) {
error->assign("XML: Failed to create parsing context.");
#ifndef NO_LOGS
debug(4, "XML: Failed parsing document.");
#endif
return false;
}
@@ -121,12 +127,16 @@ bool XML::complete(std::string *error) {
/* Clean up everything else. */
xmlFreeParserCtxt(m_data.parsing_ctx);
m_data.parsing_ctx = NULL;
#ifndef NO_LOGS
debug(4, "XML: Parsing complete (well_formed " \
+ std::to_string(m_data.well_formed) + ").");
#endif
if (m_data.well_formed != 1) {
error->assign("XML: Failed parsing document.");
#ifndef NO_LOGS
debug(4, "XML: Failed parsing document.");
#endif
return false;
}
}