Added logger, resolves #4

This commit is contained in:
2016-08-04 17:39:48 +01:00
parent 893a6cbbe1
commit a1c50b253d
10 changed files with 120 additions and 49 deletions

View File

@ -1,5 +1,7 @@
#include "HTTPHelper.hpp"
#include "../Logger.hpp"
extern std::string bot_token;
/*
@ -40,10 +42,10 @@ std::string HTTPHelper::post_request(std::string url, std::string content_type,
if (res == CURLE_OK) {
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, response_code);
} else {
Logger::write("curl error", Logger::LogLevel::Warning);
return "";
}
/* always cleanup */
curl_easy_cleanup(curl);
curl_slist_free_all(headers);
}