add logging facility and check logs in tests

This commit is contained in:
Konstantin Käfer
2014-07-11 13:55:18 -07:00
parent 8fc4d61025
commit f3c55eba9d
17 changed files with 418 additions and 23 deletions

View File

@@ -1,6 +1,7 @@
#include <llmr/platform/platform.hpp>
#include <llmr/platform/request.hpp>
#include <llmr/util/uv.hpp>
#include <llmr/platform/log.hpp>
const std::string base_directory = []{
std::string fn = __FILE__;
@@ -40,7 +41,7 @@ platform::request_http(const std::string &url,
if (err < 0) {
req->res->code = err;
req->res->error_message = uv_strerror(err);
fprintf(stderr, "[WARNING] fixture request: %s\n", uv_strerror(err));
Log::Warning(Event::HttpRequest, err, url + ": " + uv_strerror(err));
req->complete();
return req;
}
@@ -90,7 +91,8 @@ platform::request_http(const std::string &url,
req->res->body.swap(body);
req->res->code = 200;
fprintf(stderr, "[INFO] fixture request completed: %s\n", clean_url.c_str());
// fprintf(stderr, "[INFO] fixture request completed: %s\n", clean_url.c_str());
Log::Info(Event::HttpRequest, 200, url);
req->complete();
return req;