Skip to content

Commit

Permalink
Merge pull request #1549 from Expensify/cole_reply_logging
Browse files Browse the repository at this point in the history
Add logging in reply
  • Loading branch information
coleaeason authored Jul 31, 2023
2 parents f191477 + 23d2640 commit 880f247
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions BedrockServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1504,6 +1504,7 @@ void BedrockServer::_reply(unique_ptr<BedrockCommand>& command) {
const string& pluginName = command->request["plugin"];

if (command->socket) {
SINFO("[performance] Command " << command->response.methodLine << " has a socket, going to try to reply.");
if (!pluginName.empty()) {
// Let the plugin handle it
SINFO("Plugin '" << pluginName << "' handling response '" << command->response.methodLine
Expand All @@ -1516,13 +1517,13 @@ void BedrockServer::_reply(unique_ptr<BedrockCommand>& command) {
}
} else {
// Otherwise we send the standard response.
SDEBUG("About to reply to command " << command->request.methodLine);
SINFO("[performance] About to reply to command " << command->request.methodLine);
if (!command->socket->send(command->response.serialize())) {
// If we can't send (client closed the socket?), alert our plugin it's response was never sent.
SINFO("No socket to reply for: '" << command->request.methodLine << "' #" << command->initiatingClientID);
command->handleFailedReply();
} else {
SDEBUG("Replied");
SINFO("[performance] Replied");
}
}

Expand All @@ -1538,6 +1539,7 @@ void BedrockServer::_reply(unique_ptr<BedrockCommand>& command) {
}
command->handleFailedReply();
}
SINFO("[performance] Finished replying to command " << command->request.methodLine << " moving on to the next command.");
}


Expand Down

0 comments on commit 880f247

Please sign in to comment.