diff options
Diffstat (limited to 'src/mongo/embedded/embedded.cpp')
-rw-r--r-- | src/mongo/embedded/embedded.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/mongo/embedded/embedded.cpp b/src/mongo/embedded/embedded.cpp index 69911b0fa21..95ff681e5cb 100644 --- a/src/mongo/embedded/embedded.cpp +++ b/src/mongo/embedded/embedded.cpp @@ -66,6 +66,7 @@ #include "mongo/embedded/replication_coordinator_embedded.h" #include "mongo/embedded/service_entry_point_embedded.h" #include "mongo/logger/log_component.h" +#include "mongo/logv2/log.h" #include "mongo/scripting/dbdirectclient_factory.h" #include "mongo/util/background.h" #include "mongo/util/exit.h" @@ -182,7 +183,7 @@ void shutdown(ServiceContext* srvContext) { } setGlobalServiceContext(nullptr); - log(LogComponent::kControl) << "now exiting"; + LOGV2_OPTIONS(22551, {logComponentV1toV2(LogComponent::kControl)}, "now exiting"); } @@ -226,7 +227,8 @@ ServiceContext* initialize(const char* yaml_config) { } if (kDebugBuild) - log(LogComponent::kControl) << "DEBUG build (which is slower)" << endl; + LOGV2_OPTIONS( + 22552, {logComponentV1toV2(LogComponent::kControl)}, "DEBUG build (which is slower)"); // The periodic runner is required by the storage engine to be running beforehand. auto periodicRunner = std::make_unique<PeriodicRunnerEmbedded>( @@ -249,9 +251,11 @@ ServiceContext* initialize(const char* yaml_config) { // Warn if field name matches non-active registered storage engine. if (isRegisteredStorageEngine(serviceContext, e.fieldName())) { - warning() << "Detected configuration for non-active storage engine " - << e.fieldName() << " when current storage engine is " - << storageGlobalParams.engine; + LOGV2_WARNING(22554, + "Detected configuration for non-active storage engine {e_fieldName} " + "when current storage engine is {storageGlobalParams_engine}", + "e_fieldName"_attr = e.fieldName(), + "storageGlobalParams_engine"_attr = storageGlobalParams.engine); } } } @@ -286,7 +290,10 @@ ServiceContext* initialize(const char* yaml_config) { try { repairDatabasesAndCheckVersion(startupOpCtx.get()); } catch (const ExceptionFor<ErrorCodes::MustDowngrade>& error) { - severe(LogComponent::kControl) << "** IMPORTANT: " << error.toStatus().reason(); + LOGV2_FATAL_OPTIONS(22555, + {logComponentV1toV2(LogComponent::kControl)}, + "** IMPORTANT: {error_toStatus_reason}", + "error_toStatus_reason"_attr = error.toStatus().reason()); quickExit(EXIT_NEED_DOWNGRADE); } @@ -300,7 +307,7 @@ ServiceContext* initialize(const char* yaml_config) { } if (storageGlobalParams.upgrade) { - log() << "finished checking dbs"; + LOGV2(22553, "finished checking dbs"); exitCleanly(EXIT_CLEAN); } |