Refine logger; add UrlQuery for query parameters.

This commit is contained in:
Adam Gu
2018-05-11 17:14:32 +08:00
parent 2496862fa0
commit b6ebba771b
20 changed files with 149 additions and 89 deletions
+4 -2
View File
@@ -1,6 +1,7 @@
#include "calc_client.h"
#include <iostream>
#include "boost/lexical_cast.hpp"
#include "webcc/logger.h"
// Set to 0 to test our own calculator server created with webcc.
#define ACCESS_PARASOFT 0
@@ -71,8 +72,9 @@ bool CalcClient::Calc(const std::string& operation,
// Error handling if any.
if (error != webcc::kNoError) {
std::cerr << "Error: " << error;
std::cerr << ", " << webcc::GetErrorMessage(error) << std::endl;
LOG_ERRO("Operation '%s' failed: %s",
operation.c_str(),
webcc::GetErrorMessage(error));
return false;
}
+3
View File
@@ -1,7 +1,10 @@
#include <iostream>
#include "webcc/logger.h"
#include "calc_client.h"
int main() {
LOG_INIT(webcc::INFO, 0);
CalcClient calc;
double x = 1.0;
+1 -1
View File
@@ -15,7 +15,7 @@ int main(int argc, char* argv[]) {
return 1;
}
LOG_INIT(webcc::VERB, 0);
LOG_INIT(webcc::INFO, 0);
unsigned short port = std::atoi(argv[1]);