Refine logger; add UrlQuery for query parameters.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user