Add console logger to replace original debug output.

This commit is contained in:
Adam Gu
2018-04-24 17:24:55 +08:00
parent bcfb1e4c92
commit 662b7c4112
17 changed files with 242 additions and 112 deletions
+4 -1
View File
@@ -3,6 +3,7 @@
#include "boost/algorithm/string.hpp"
#include "json/json.h" // jsoncpp
#include "webcc/logger.h"
#include "webcc/http_client.h"
#include "webcc/http_request.h"
#include "webcc/http_response.h"
@@ -54,7 +55,7 @@ public:
return false;
}
std::cout << http_response.content() << std::endl;
std::cout << "result:\n" << http_response.content() << std::endl;
return true;
}
@@ -174,6 +175,8 @@ int main(int argc, char* argv[]) {
return 1;
}
LOG_INIT(webcc::VERB, 0);
g_host = argv[1];
g_port = argv[2];
+5
View File
@@ -1,5 +1,8 @@
#include <iostream>
#include "webcc/logger.h"
#include "webcc/rest_server.h"
#include "book_services.h"
static void Help(const char* argv0) {
@@ -14,6 +17,8 @@ int main(int argc, char* argv[]) {
return 1;
}
LOG_INIT(webcc::VERB, 0);
unsigned short port = std::atoi(argv[1]);
std::size_t workers = 2;