diff options
Diffstat (limited to 'src/mongo/util/platform_init.cpp')
-rw-r--r-- | src/mongo/util/platform_init.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mongo/util/platform_init.cpp b/src/mongo/util/platform_init.cpp index 335cd5c7bf6..0299d467f33 100644 --- a/src/mongo/util/platform_init.cpp +++ b/src/mongo/util/platform_init.cpp @@ -39,6 +39,7 @@ #endif #include "mongo/base/init.h" +#include "mongo/logv2/log.h" #include "mongo/util/log.h" #include "mongo/util/stacktrace.h" @@ -71,8 +72,11 @@ extern "C" { int __cdecl crtDebugCallback(int nRptType, char* originalMessage, int* returnValue) noexcept { *returnValue = 0; // Returned by _CrtDbgReport. (1: starts the debugger). bool die = (nRptType != _CRT_WARN); - log() << "*** C runtime " << severity(nRptType) << ": " << firstLine(originalMessage) - << (die ? ", terminating"_sd : ""_sd); + LOGV2(23325, + "*** C runtime {severity_nRptType}: {firstLine_originalMessage}{die_terminating_sd_sd}", + "severity_nRptType"_attr = severity(nRptType), + "firstLine_originalMessage"_attr = firstLine(originalMessage), + "die_terminating_sd_sd"_attr = (die ? ", terminating"_sd : ""_sd)); if (die) { fassertFailed(17006); } @@ -89,7 +93,7 @@ MONGO_INITIALIZER(Behaviors_Win32)(InitializerContext*) { _CrtSetReportHook(&crtDebugCallback); if (_setmaxstdio(2048) == -1) { - warning() << "Failed to increase max open files limit from default of 512 to 2048"; + LOGV2_WARNING(23326, "Failed to increase max open files limit from default of 512 to 2048"); } // Let's try to set minimum Windows Kernel quantum length to smallest viable timer resolution in @@ -101,9 +105,9 @@ MONGO_INITIALIZER(Behaviors_Win32)(InitializerContext*) { int timerResolution; if (timeGetDevCaps(&tc, sizeof(TIMECAPS)) != TIMERR_NOERROR) { - warning() << "Failed to read timer resolution range."; + LOGV2_WARNING(23327, "Failed to read timer resolution range."); if (timeBeginPeriod(1) != TIMERR_NOERROR) { - warning() << "Failed to set minimum timer resolution to 1 millisecond."; + LOGV2_WARNING(23328, "Failed to set minimum timer resolution to 1 millisecond."); } } else { timerResolution = |