Merge pull request #591 from markdewing/PRE_output

Sent output of ReportEngine to debug stream
This commit is contained in:
Paul R. C. Kent 2017-12-19 15:04:15 -05:00 committed by GitHub
commit 17cfa871e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -24,16 +24,16 @@ void ReportEngine::echo(xmlNodePtr cur, bool recursive)
{
if(cur==NULL)
return;
app_log()<< "<input node=\""<<(const char*)(cur->name) << "\"";
app_debug()<< "<input node=\""<<(const char*)(cur->name) << "\"";
xmlAttrPtr att = cur->properties;
char atext[1024];
while(att != NULL)
{
sprintf(atext," %s=\"%s\"",(const char*)(att->name),(const char*)(att->children->content));
app_log() << atext;
app_debug() << atext;
att = att->next;
}
app_log() << "/>\n";
app_debug() << "/>\n";
}
bool ReportEngine::DoOutput = false;

View File

@ -37,7 +37,7 @@ class ReportEngine
public:
inline ReportEngine(const std::string& cname, const std::string& fname, int atype=1):
ReportType(atype),ClassName(cname), LogBuffer(infoLog), FuncName(fname)
ReportType(atype),ClassName(cname), LogBuffer(infoDebug), FuncName(fname)
{
if (DoOutput) {
LogBuffer << " " << ClassName << "::" << FuncName << "\n";
@ -75,7 +75,7 @@ public:
inline void error(const std::string& msg, bool fatal=false)
{
LogBuffer << ("ERROR: "+msg+"\n");
app_error() << ("ERROR: "+msg+"\n");
if(fatal)
APP_ABORT(ClassName+"::"+FuncName);
}
@ -103,7 +103,7 @@ private:
*/
InfoStream& LogBuffer;
//disable copy constructor
ReportEngine(const ReportEngine& a):LogBuffer(infoLog) {}
ReportEngine(const ReportEngine& a):LogBuffer(infoDebug) {}
static bool DoOutput;
@ -114,7 +114,7 @@ template<class T>
inline
ReportEngine& operator<<(ReportEngine& o, const T& val)
{
app_log()<< val;
app_debug() << val;
return o;
}
}