diff options
author | Amirsaman Memaripour <amirsaman.memaripour@mongodb.com> | 2020-04-03 09:46:45 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-04-03 14:18:38 +0000 |
commit | 0decca93cfd99752e7918e3ca8ecf6255d6069f2 (patch) | |
tree | f6d766222d350fe30a438245e9905c531fad3580 /src/mongo/db/commands.cpp | |
parent | ca49965d8d68cc853e466ba741df08bb248d46f6 (diff) | |
download | mongo-0decca93cfd99752e7918e3ca8ecf6255d6069f2.tar.gz |
SERVER-47077 Clean up log lines in 'mongo/db'
Cleaning up log lines to adhere to the LOGV2 style guide.
Diffstat (limited to 'src/mongo/db/commands.cpp')
-rw-r--r-- | src/mongo/db/commands.cpp | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/src/mongo/db/commands.cpp b/src/mongo/db/commands.cpp index 0d44fbd6a6e..f9158eb2a62 100644 --- a/src/mongo/db/commands.cpp +++ b/src/mongo/db/commands.cpp @@ -596,9 +596,9 @@ void CommandHelpers::evaluateFailCommandFailPoint(OperationContext* opCtx, if (closeConnection) { opCtx->getClient()->session()->end(); LOGV2(20431, - "Failing command '{cmd_getName}' via 'failCommand' failpoint. Action: " - "closing connection.", - "cmd_getName"_attr = cmd->getName()); + "Failing {command} via 'failCommand' failpoint: closing connection", + "Failing command via 'failCommand' failpoint: closing connection", + "command"_attr = cmd->getName()); uasserted(50985, "Failing command due to 'failCommand' failpoint"); } @@ -613,32 +613,35 @@ void CommandHelpers::evaluateFailCommandFailPoint(OperationContext* opCtx, blockTimeMS >= 0); LOGV2(20432, - "Blocking command '{cmd_getName}' via 'failCommand' failpoint for " - "{blockTimeMS} milliseconds", - "cmd_getName"_attr = cmd->getName(), - "blockTimeMS"_attr = blockTimeMS); + "Blocking {command} via 'failCommand' failpoint for {blockTime}", + "Blocking command via 'failCommand' failpoint", + "command"_attr = cmd->getName(), + "blockTime"_attr = Milliseconds{blockTimeMS}); opCtx->sleepFor(Milliseconds{blockTimeMS}); LOGV2(20433, - "Unblocking command '{cmd_getName}' via 'failCommand' failpoint", - "cmd_getName"_attr = cmd->getName()); + "Unblocking {command} via 'failCommand' failpoint", + "Unblocking command via 'failCommand' failpoint", + "command"_attr = cmd->getName()); } if (hasExtraInfo) { LOGV2(20434, - "Failing command '{cmd_getName}' via 'failCommand' failpoint. Action: " - "returning error code {errorCode} and {errorExtraInfo}.", - "cmd_getName"_attr = cmd->getName(), + "Failing {command} via 'failCommand' failpoint: returning {errorCode} and " + "{errorExtraInfo}", + "Failing command via 'failCommand' failpoint", + "command"_attr = cmd->getName(), "errorCode"_attr = errorCode, "errorExtraInfo"_attr = errorExtraInfo); uassertStatusOK(Status(ErrorCodes::Error(errorCode), "Failing command due to 'failCommand' failpoint", errorExtraInfo.Obj())); } else if (hasErrorCode) { - LOGV2(20435, - "Failing command '{cmd_getName}' via 'failCommand' failpoint. Action: " - "returning error code {errorCode}.", - "cmd_getName"_attr = cmd->getName(), - "errorCode"_attr = errorCode); + LOGV2( + 20435, + "Failing command {command} via 'failCommand' failpoint: returning {errorCode}", + "Failing command via 'failCommand' failpoint", + "command"_attr = cmd->getName(), + "errorCode"_attr = errorCode); uasserted(ErrorCodes::Error(errorCode), "Failing command due to 'failCommand' failpoint"); } @@ -725,8 +728,9 @@ void CommandInvocation::checkAuthorization(OperationContext* opCtx, } catch (const DBException& e) { LOGV2_OPTIONS(20436, {logComponentV1toV2(LogComponent::kAccessControl)}, - "{e_toStatus}", - "e_toStatus"_attr = e.toStatus()); + "Checking authorization failed: {error}", + "Checking authorization failed", + "error"_attr = e.toStatus()); CommandHelpers::auditLogAuthEvent(opCtx, this, request, e.code()); throw; } |