Adds request IDs and URIs to the debug log

This commit is contained in:
Felipe Zimmerle
2018-09-24 21:07:11 -03:00
parent 0e8cd767e7
commit c721e101c0
8 changed files with 63 additions and 38 deletions

View File

@@ -72,6 +72,18 @@ int DebugLog::getDebugLogLevel() {
}
void DebugLog::write(int level, const std::string &id,
const std::string &uri, const std::string &msg) {
if (level <= m_debugLevel) {
std::string msgf = "[" + std::to_string(level) + "] " + msg;
msgf = "[" + id + "] [" + uri + "] " + msgf;
DebugLogWriter &d = DebugLogWriter::getInstance();
d.write_log(m_fileName, msgf);
}
}
void DebugLog::write(int level, const std::string &msg) {
if (level <= m_debugLevel) {
std::string msgf = "[" + std::to_string(level) + "] " + msg;