@@ -11,7 +11,7 @@ RpcServer::RpcServer() {
1111}
1212
1313void RpcServer::StartServer () {
14- LOG_INFO (" RpcServer started" );
14+ // LOG_INFO("RpcServer started");
1515 tcp_server_.RunLoop ();
1616}
1717
@@ -23,7 +23,7 @@ void RpcServer::HandleRequest(std::string& request, std::string& response) {
2323 rpc::RpcMessage request_message;
2424 request_message.ParseFromString (request);
2525
26- LOG_DEBUG (" Received request: \n " + request_message.DebugString ());
26+ // LOG_DEBUG("Received request: \n" + request_message.DebugString());
2727
2828 if (!CheckRequest (request_message)) {
2929 rpc::RpcMessage response_message;
@@ -52,27 +52,27 @@ void RpcServer::HandleRequest(std::string& request, std::string& response) {
5252 response_message.set_response (method_response->SerializeAsString ());
5353 response_message.SerializeToString (&response);
5454
55- LOG_DEBUG (" Send response: \n " + response_message.DebugString ());
55+ // LOG_DEBUG("Send response: \n" + response_message.DebugString());
5656}
5757
5858bool RpcServer::CheckRequest (rpc::RpcMessage request) {
5959 if (request.type () != rpc::RPC_TYPE_REQUEST) {
60- LOG_ERROR (" Invalid request type: " + std::to_string (request.type ()));
60+ // LOG_ERROR("Invalid request type: " + std::to_string(request.type()));
6161 return false ;
6262 }
6363
6464 if (request.method_name ().empty ()) {
65- LOG_ERROR (" Empty method name" );
65+ // LOG_ERROR("Empty method name");
6666 return false ;
6767 }
6868
6969 if (request.service_name ().empty ()) {
70- LOG_ERROR (" Empty service name" );
70+ // LOG_ERROR("Empty service name");
7171 return false ;
7272 }
7373
7474 if (service_map_.find (request.service_name ()) == service_map_.end ()) {
75- LOG_ERROR (" Service not found: " + request.service_name ());
75+ // LOG_ERROR("Service not found: " + request.service_name());
7676 return false ;
7777 }
7878 auto service = service_map_.find (request.service_name ())->second ;
@@ -84,12 +84,12 @@ bool RpcServer::CheckRequest(rpc::RpcMessage request) {
8484 auto service_desc = service->GetDescriptor ();
8585 auto method_desc = service_desc->FindMethodByName (request.method_name ());
8686 if (method_desc == nullptr ) {
87- LOG_ERROR (" Method not found: " + request.method_name ());
87+ // LOG_ERROR("Method not found: " + request.method_name());
8888 return false ;
8989 }
9090
9191 if (request.request ().empty ()) {
92- LOG_ERROR (" Empty request" );
92+ // LOG_ERROR("Empty request");
9393 return false ;
9494 }
9595
0 commit comments