summaryrefslogtreecommitdiff
path: root/src/mongo/db/write_concern.cpp
diff options
context:
space:
mode:
authorGabriel Russell <gabriel.russell@mongodb.com>2020-02-13 11:49:46 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-13 18:16:35 +0000
commita84c09a19720b73cedb2e8ef7c5cfeedfa1c9761 (patch)
tree85ac46cd5f4ea6d5134560bf764fb9e6cf11fe4e /src/mongo/db/write_concern.cpp
parent6df40e01f7b6899affc4536e7e73a35802cabf98 (diff)
downloadmongo-a84c09a19720b73cedb2e8ef7c5cfeedfa1c9761.tar.gz
SERVER-45869 automatically converted structured logging
Diffstat (limited to 'src/mongo/db/write_concern.cpp')
-rw-r--r--src/mongo/db/write_concern.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/mongo/db/write_concern.cpp b/src/mongo/db/write_concern.cpp
index 546a590c9b5..3f55e87de40 100644
--- a/src/mongo/db/write_concern.cpp
+++ b/src/mongo/db/write_concern.cpp
@@ -47,6 +47,7 @@
#include "mongo/db/storage/storage_engine.h"
#include "mongo/db/transaction_validation.h"
#include "mongo/db/write_concern_options.h"
+#include "mongo/logv2/log.h"
#include "mongo/rpc/protocol.h"
#include "mongo/util/fail_point.h"
#include "mongo/util/log.h"
@@ -97,8 +98,13 @@ StatusWith<WriteConcernOptions> extractWriteConcern(OperationContext* opCtx,
auto wcDefault = ReadWriteConcernDefaults::get(opCtx->getServiceContext())
.getDefaultWriteConcern(opCtx);
if (wcDefault) {
- LOG(2) << "Applying default writeConcern on " << cmdObj.firstElementFieldName()
- << " of " << wcDefault->toBSON();
+ LOGV2_DEBUG(22548,
+ 2,
+ "Applying default writeConcern on {cmdObj_firstElementFieldName} "
+ "of {wcDefault}",
+ "cmdObj_firstElementFieldName"_attr =
+ cmdObj.firstElementFieldName(),
+ "wcDefault"_attr = wcDefault->toBSON());
return *wcDefault;
}
}
@@ -210,8 +216,11 @@ Status waitForWriteConcern(OperationContext* opCtx,
const OpTime& replOpTime,
const WriteConcernOptions& writeConcern,
WriteConcernResult* result) {
- LOG(2) << "Waiting for write concern. OpTime: " << replOpTime
- << ", write concern: " << writeConcern.toBSON();
+ LOGV2_DEBUG(22549,
+ 2,
+ "Waiting for write concern. OpTime: {replOpTime}, write concern: {writeConcern}",
+ "replOpTime"_attr = replOpTime,
+ "writeConcern"_attr = writeConcern.toBSON());
auto const replCoord = repl::ReplicationCoordinator::get(opCtx);
@@ -227,7 +236,7 @@ Status waitForWriteConcern(OperationContext* opCtx,
switch (writeConcernWithPopulatedSyncMode.syncMode) {
case WriteConcernOptions::SyncMode::UNSET:
- severe() << "Attempting to wait on a WriteConcern with an unset sync option";
+ LOGV2_FATAL(22550, "Attempting to wait on a WriteConcern with an unset sync option");
fassertFailed(34410);
case WriteConcernOptions::SyncMode::NONE:
break;