Show off, with some variadic templates, for the logger module

This commit is contained in:
louiz’
2016-06-13 20:46:30 +02:00
parent ad4ccdbbea
commit 5a2e611617
9 changed files with 115 additions and 71 deletions
+3 -3
View File
@@ -56,7 +56,7 @@ int XmppParser::feed(const char* data, const int len, const bool is_final)
int res = XML_Parse(this->parser, data, len, is_final);
if (res == XML_STATUS_ERROR &&
(XML_GetErrorCode(this->parser) != XML_ERROR_FINISHED))
log_error("Xml_Parse encountered an error: " <<
log_error("Xml_Parse encountered an error: ",
XML_ErrorString(XML_GetErrorCode(this->parser)));
return res;
}
@@ -65,7 +65,7 @@ int XmppParser::parse(const int len, const bool is_final)
{
int res = XML_ParseBuffer(this->parser, len, is_final);
if (res == XML_STATUS_ERROR)
log_error("Xml_Parsebuffer encountered an error: " <<
log_error("Xml_Parsebuffer encountered an error: ",
XML_ErrorString(XML_GetErrorCode(this->parser)));
return res;
}
@@ -139,7 +139,7 @@ void XmppParser::stanza_event(const Stanza& stanza) const
try {
callback(stanza);
} catch (const std::exception& e) {
log_error("Unhandled exception: " << e.what());
log_error("Unhandled exception: ", e.what());
}
}
}