diff options
author | Gabriel Russell <gabriel.russell@mongodb.com> | 2020-02-13 11:49:46 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-02-13 18:16:35 +0000 |
commit | a84c09a19720b73cedb2e8ef7c5cfeedfa1c9761 (patch) | |
tree | 85ac46cd5f4ea6d5134560bf764fb9e6cf11fe4e /src/mongo/db/repl/storage_interface_impl.cpp | |
parent | 6df40e01f7b6899affc4536e7e73a35802cabf98 (diff) | |
download | mongo-a84c09a19720b73cedb2e8ef7c5cfeedfa1c9761.tar.gz |
SERVER-45869 automatically converted structured logging
Diffstat (limited to 'src/mongo/db/repl/storage_interface_impl.cpp')
-rw-r--r-- | src/mongo/db/repl/storage_interface_impl.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/mongo/db/repl/storage_interface_impl.cpp b/src/mongo/db/repl/storage_interface_impl.cpp index 17af180cd45..92841eeacae 100644 --- a/src/mongo/db/repl/storage_interface_impl.cpp +++ b/src/mongo/db/repl/storage_interface_impl.cpp @@ -76,6 +76,7 @@ #include "mongo/db/service_context.h" #include "mongo/db/storage/durable_catalog.h" #include "mongo/db/storage/oplog_cap_maintainer_thread.h" +#include "mongo/logv2/log.h" #include "mongo/util/assert_util.h" #include "mongo/util/background.h" #include "mongo/util/log.h" @@ -190,7 +191,10 @@ StorageInterfaceImpl::createCollectionForBulkLoading( const BSONObj idIndexSpec, const std::vector<BSONObj>& secondaryIndexSpecs) { - LOG(2) << "StorageInterfaceImpl::createCollectionForBulkLoading called for ns: " << nss.ns(); + LOGV2_DEBUG(21753, + 2, + "StorageInterfaceImpl::createCollectionForBulkLoading called for ns: {nss_ns}", + "nss_ns"_attr = nss.ns()); class StashClient { public: @@ -384,7 +388,9 @@ Status StorageInterfaceImpl::dropReplicatedDatabases(OperationContext* opCtx) { std::vector<std::string> dbNames = opCtx->getServiceContext()->getStorageEngine()->listDatabases(); invariant(!dbNames.empty()); - log() << "dropReplicatedDatabases - dropping " << dbNames.size() << " databases"; + LOGV2(21754, + "dropReplicatedDatabases - dropping {dbNames_size} databases", + "dbNames_size"_attr = dbNames.size()); ReplicationCoordinator::get(opCtx)->dropAllSnapshots(); @@ -401,14 +407,17 @@ Status StorageInterfaceImpl::dropReplicatedDatabases(OperationContext* opCtx) { } else { // This is needed since dropDatabase can't be rolled back. // This is safe be replaced by "invariant(db);dropDatabase(opCtx, db);" once fixed. - log() << "dropReplicatedDatabases - database disappeared after retrieving list of " - "database names but before drop: " - << dbName; + LOGV2(21755, + "dropReplicatedDatabases - database disappeared after retrieving list of " + "database names but before drop: {dbName}", + "dbName"_attr = dbName); } }); } invariant(hasLocalDatabase, "local database missing"); - log() << "dropReplicatedDatabases - dropped " << dbNames.size() << " databases"; + LOGV2(21756, + "dropReplicatedDatabases - dropped {dbNames_size} databases", + "dbNames_size"_attr = dbNames.size()); return Status::OK(); } |