diff options
author | Reo Kimura <reo.kimura@mongodb.com> | 2020-07-02 21:51:37 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-07-09 17:14:19 +0000 |
commit | 4975a3041ada1fdf8d8c561c7d30eddaac677557 (patch) | |
tree | 217bedaa7a0235fea1ce337d1dfaeba434ad3738 | |
parent | e0ec3c2c1be2bd0d3263d059610579dfc94bfa7d (diff) | |
download | mongo-4975a3041ada1fdf8d8c561c7d30eddaac677557.tar.gz |
SERVER-48205 added log statements to provide context on returned responses
-rw-r--r-- | src/mongo/executor/network_interface_integration_fixture.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/mongo/executor/network_interface_integration_fixture.cpp b/src/mongo/executor/network_interface_integration_fixture.cpp index 1e36b797614..41ceaa29e39 100644 --- a/src/mongo/executor/network_interface_integration_fixture.cpp +++ b/src/mongo/executor/network_interface_integration_fixture.cpp @@ -108,7 +108,16 @@ Future<RemoteCommandResponse> NetworkInterfaceIntegrationFixture::runCommand( RemoteCommandRequestOnAny rcroa{request}; return net().startCommand(cbHandle, rcroa).then([](TaskExecutor::ResponseOnAnyStatus roa) { - return RemoteCommandResponse(roa); + auto& res = RemoteCommandResponse(roa); + if (res.isOK()) { + LOGV2(48205, + "Got command result: {response}", + "Got command result", + "response"_attr = res.toString()); + } else { + LOGV2(48205, "Command failed: {error}", "Command failed", "error"_attr = res.status); + } + return res; }); } @@ -117,6 +126,14 @@ Future<RemoteCommandOnAnyResponse> NetworkInterfaceIntegrationFixture::runComman RemoteCommandRequestOnAny rcroa{request}; return net().startCommand(cbHandle, rcroa).then([](TaskExecutor::ResponseOnAnyStatus roa) { + if (roa.isOK()) { + LOGV2(48205, + "Got command result: {response}", + "Got command result", + "response"_attr = roa.toString()); + } else { + LOGV2(48205, "Command failed: {error}", "Command failed", "error"_attr = roa.status); + } return roa; }); } @@ -158,14 +175,6 @@ RemoteCommandResponse NetworkInterfaceIntegrationFixture::runCommandSync( RemoteCommandRequest& request) { auto deferred = runCommand(makeCallbackHandle(), request); auto& res = deferred.get(); - if (res.isOK()) { - LOGV2(22586, - "Got command result: {response}", - "Got command result", - "response"_attr = res.toString()); - } else { - LOGV2(22587, "Command failed: {error}", "Command failed", "error"_attr = res.status); - } return res; } |