summaryrefslogtreecommitdiff
path: root/src/mongo/util
diff options
context:
space:
mode:
authorGabriel Russell <gabriel.russell@mongodb.com>2020-02-20 16:05:48 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-21 20:12:44 +0000
commit0f7625b5cdbc24ed0fce1e168059118cb025d869 (patch)
tree3ea90b71ed2510e220140626b351f6e998d2d8b7 /src/mongo/util
parent3463ea25afcbf2c07b96f043904961b5c0f04474 (diff)
downloadmongo-0f7625b5cdbc24ed0fce1e168059118cb025d869.tar.gz
SERVER-45567 removing util/log.h where I can
o converting some log lines that were missed o fixing some missing includes create mode 100644 src/mongo/transport/ismaster_metrics.cpp
Diffstat (limited to 'src/mongo/util')
-rw-r--r--src/mongo/util/alarm_test.cpp1
-rw-r--r--src/mongo/util/background.cpp1
-rw-r--r--src/mongo/util/background_thread_clock_source.cpp1
-rw-r--r--src/mongo/util/concurrency/thread_name.cpp1
-rw-r--r--src/mongo/util/concurrency/thread_pool_test.cpp1
-rw-r--r--src/mongo/util/concurrency/thread_pool_test_common.cpp10
-rw-r--r--src/mongo/util/concurrency/ticketholder.cpp1
-rw-r--r--src/mongo/util/concurrency/with_lock_test.cpp1
-rw-r--r--src/mongo/util/decorable_test.cpp1
-rw-r--r--src/mongo/util/diagnostic_info.cpp1
-rw-r--r--src/mongo/util/diagnostic_info_test.cpp1
-rw-r--r--src/mongo/util/exception_filter_win32.cpp1
-rw-r--r--src/mongo/util/exit.cpp1
-rw-r--r--src/mongo/util/fail_point.cpp1
-rw-r--r--src/mongo/util/file.cpp1
-rw-r--r--src/mongo/util/heap_profiler.cpp1
-rw-r--r--src/mongo/util/net/hostname_canonicalization.cpp1
-rw-r--r--src/mongo/util/net/http_client_curl.cpp1
-rw-r--r--src/mongo/util/net/http_client_winhttp.cpp1
-rw-r--r--src/mongo/util/net/openssl_init.cpp1
-rw-r--r--src/mongo/util/net/private/ssl_expiration.cpp1
-rw-r--r--src/mongo/util/net/socket_utils.cpp2
-rw-r--r--src/mongo/util/net/ssl_manager.cpp1
-rw-r--r--src/mongo/util/net/ssl_manager_apple.cpp1
-rw-r--r--src/mongo/util/net/ssl_manager_openssl.cpp7
-rw-r--r--src/mongo/util/net/ssl_manager_test.cpp1
-rw-r--r--src/mongo/util/net/ssl_manager_windows.cpp1
-rw-r--r--src/mongo/util/net/ssl_options.cpp1
-rw-r--r--src/mongo/util/net/ssl_options_server.cpp1
-rw-r--r--src/mongo/util/net/ssl_parameters.cpp1
-rw-r--r--src/mongo/util/ntservice.cpp1
-rw-r--r--src/mongo/util/options_parser/options_parser.cpp1
-rw-r--r--src/mongo/util/password.cpp2
-rw-r--r--src/mongo/util/perfctr_collect.cpp2
-rw-r--r--src/mongo/util/perfctr_collect_test.cpp1
-rw-r--r--src/mongo/util/periodic_runner_impl.cpp1
-rw-r--r--src/mongo/util/platform_init.cpp1
-rw-r--r--src/mongo/util/processinfo.cpp1
-rw-r--r--src/mongo/util/processinfo_freebsd.cpp1
-rw-r--r--src/mongo/util/processinfo_linux.cpp1
-rw-r--r--src/mongo/util/processinfo_openbsd.cpp1
-rw-r--r--src/mongo/util/processinfo_osx.cpp1
-rw-r--r--src/mongo/util/processinfo_solaris.cpp1
-rw-r--r--src/mongo/util/processinfo_windows.cpp1
-rw-r--r--src/mongo/util/procparser.cpp24
-rw-r--r--src/mongo/util/procparser_test.cpp1
-rw-r--r--src/mongo/util/signal_handlers_synchronous.cpp1
-rw-r--r--src/mongo/util/stacktrace_somap.cpp29
-rw-r--r--src/mongo/util/stacktrace_test.cpp1
-rw-r--r--src/mongo/util/stacktrace_threads.cpp1
-rw-r--r--src/mongo/util/stacktrace_windows.cpp1
-rw-r--r--src/mongo/util/string_map_test.cpp1
-rw-r--r--src/mongo/util/tcmalloc_server_status_section.cpp1
-rw-r--r--src/mongo/util/time_support_test.cpp2
-rw-r--r--src/mongo/util/version.cpp1
-rw-r--r--src/mongo/util/version_impl.cpp4
56 files changed, 55 insertions, 74 deletions
diff --git a/src/mongo/util/alarm_test.cpp b/src/mongo/util/alarm_test.cpp
index 9a712544d4b..b1eba261cee 100644
--- a/src/mongo/util/alarm_test.cpp
+++ b/src/mongo/util/alarm_test.cpp
@@ -36,7 +36,6 @@
#include "mongo/util/alarm.h"
#include "mongo/util/alarm_runner_background_thread.h"
#include "mongo/util/clock_source_mock.h"
-#include "mongo/util/log.h"
namespace mongo {
namespace {
diff --git a/src/mongo/util/background.cpp b/src/mongo/util/background.cpp
index 995f3558017..d1db0ce6ee3 100644
--- a/src/mongo/util/background.cpp
+++ b/src/mongo/util/background.cpp
@@ -46,7 +46,6 @@
#include "mongo/util/concurrency/thread_name.h"
#include "mongo/util/debug_util.h"
#include "mongo/util/hierarchical_acquisition.h"
-#include "mongo/util/log.h"
#include "mongo/util/str.h"
#include "mongo/util/timer.h"
diff --git a/src/mongo/util/background_thread_clock_source.cpp b/src/mongo/util/background_thread_clock_source.cpp
index 36eb958f7b8..90dd8bb085f 100644
--- a/src/mongo/util/background_thread_clock_source.cpp
+++ b/src/mongo/util/background_thread_clock_source.cpp
@@ -39,7 +39,6 @@
#include "mongo/stdx/thread.h"
#include "mongo/util/concurrency/idle_thread_block.h"
-#include "mongo/util/log.h"
#include "mongo/util/time_support.h"
namespace mongo {
diff --git a/src/mongo/util/concurrency/thread_name.cpp b/src/mongo/util/concurrency/thread_name.cpp
index ecd727c4c79..73444d5e6bc 100644
--- a/src/mongo/util/concurrency/thread_name.cpp
+++ b/src/mongo/util/concurrency/thread_name.cpp
@@ -53,7 +53,6 @@
#include "mongo/config.h"
#include "mongo/logv2/log.h"
#include "mongo/platform/atomic_word.h"
-#include "mongo/util/log.h"
#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/util/concurrency/thread_pool_test.cpp b/src/mongo/util/concurrency/thread_pool_test.cpp
index fc246470bf1..9546a3366d6 100644
--- a/src/mongo/util/concurrency/thread_pool_test.cpp
+++ b/src/mongo/util/concurrency/thread_pool_test.cpp
@@ -43,7 +43,6 @@
#include "mongo/util/concurrency/thread_pool.h"
#include "mongo/util/concurrency/thread_pool_test_common.h"
#include "mongo/util/concurrency/thread_pool_test_fixture.h"
-#include "mongo/util/log.h"
#include "mongo/util/time_support.h"
#include "mongo/util/timer.h"
diff --git a/src/mongo/util/concurrency/thread_pool_test_common.cpp b/src/mongo/util/concurrency/thread_pool_test_common.cpp
index 2e5d74e0ab9..7c440579160 100644
--- a/src/mongo/util/concurrency/thread_pool_test_common.cpp
+++ b/src/mongo/util/concurrency/thread_pool_test_common.cpp
@@ -35,13 +35,13 @@
#include <memory>
+#include "mongo/logv2/log.h"
#include "mongo/platform/mutex.h"
#include "mongo/stdx/condition_variable.h"
#include "mongo/unittest/death_test.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/concurrency/thread_pool_interface.h"
#include "mongo/util/concurrency/thread_pool_test_fixture.h"
-#include "mongo/util/log.h"
namespace mongo {
namespace {
@@ -78,7 +78,9 @@ public:
TptRegistrationAgent(const std::string& name, ThreadPoolTestCaseFactory makeTest) {
auto& entry = threadPoolTestCaseRegistry()[name];
if (entry) {
- severe() << "Multiple attempts to register ThreadPoolTest named " << name;
+ LOGV2_FATAL(23922,
+ "Multiple attempts to register ThreadPoolTest named {name}",
+ "name"_attr = name);
fassertFailed(34355);
}
entry = std::move(makeTest);
@@ -94,7 +96,9 @@ public:
TptDeathRegistrationAgent(const std::string& name, ThreadPoolTestCaseFactory makeTest) {
auto& entry = threadPoolTestCaseRegistry()[name];
if (entry) {
- severe() << "Multiple attempts to register ThreadPoolDeathTest named " << name;
+ LOGV2_FATAL(23923,
+ "Multiple attempts to register ThreadPoolDeathTest named {name}",
+ "name"_attr = name);
fassertFailed(34356);
}
entry = [makeTest](ThreadPoolFactory makeThreadPool) {
diff --git a/src/mongo/util/concurrency/ticketholder.cpp b/src/mongo/util/concurrency/ticketholder.cpp
index 13430c48640..45bf7e51bc2 100644
--- a/src/mongo/util/concurrency/ticketholder.cpp
+++ b/src/mongo/util/concurrency/ticketholder.cpp
@@ -36,7 +36,6 @@
#include <iostream>
#include "mongo/logv2/log.h"
-#include "mongo/util/log.h"
#include "mongo/util/str.h"
namespace mongo {
diff --git a/src/mongo/util/concurrency/with_lock_test.cpp b/src/mongo/util/concurrency/with_lock_test.cpp
index 1c5f6acf375..8f3b7e3cda0 100644
--- a/src/mongo/util/concurrency/with_lock_test.cpp
+++ b/src/mongo/util/concurrency/with_lock_test.cpp
@@ -35,7 +35,6 @@
#include "mongo/platform/mutex.h"
#include "mongo/unittest/unittest.h"
#include "mongo/util/concurrency/with_lock.h"
-#include "mongo/util/log.h"
#include <iostream>
diff --git a/src/mongo/util/decorable_test.cpp b/src/mongo/util/decorable_test.cpp
index 6257b840f4a..7c414958e70 100644
--- a/src/mongo/util/decorable_test.cpp
+++ b/src/mongo/util/decorable_test.cpp
@@ -38,7 +38,6 @@
#include "mongo/util/decorable.h"
#include "mongo/util/decoration_container.h"
#include "mongo/util/decoration_registry.h"
-#include "mongo/util/log.h"
namespace mongo {
namespace {
diff --git a/src/mongo/util/diagnostic_info.cpp b/src/mongo/util/diagnostic_info.cpp
index b561c588ee3..9e8b6249167 100644
--- a/src/mongo/util/diagnostic_info.cpp
+++ b/src/mongo/util/diagnostic_info.cpp
@@ -45,7 +45,6 @@
#include "mongo/util/clock_source.h"
#include "mongo/util/hierarchical_acquisition.h"
#include "mongo/util/interruptible.h"
-#include "mongo/util/log.h"
using namespace fmt::literals;
diff --git a/src/mongo/util/diagnostic_info_test.cpp b/src/mongo/util/diagnostic_info_test.cpp
index 3c054d685dc..afdc357f0f3 100644
--- a/src/mongo/util/diagnostic_info_test.cpp
+++ b/src/mongo/util/diagnostic_info_test.cpp
@@ -37,7 +37,6 @@
#include "mongo/platform/compiler.h"
#include "mongo/unittest/unittest.h"
#include "mongo/util/clock_source_mock.h"
-#include "mongo/util/log.h"
namespace mongo {
TEST(DiagnosticInfo, BasicSingleThread) {
diff --git a/src/mongo/util/exception_filter_win32.cpp b/src/mongo/util/exception_filter_win32.cpp
index b9d84dcee1f..26efcd8819e 100644
--- a/src/mongo/util/exception_filter_win32.cpp
+++ b/src/mongo/util/exception_filter_win32.cpp
@@ -45,7 +45,6 @@
#include "mongo/logv2/log.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/exit_code.h"
-#include "mongo/util/log.h"
#include "mongo/util/quick_exit.h"
#include "mongo/util/stacktrace_windows.h"
#include "mongo/util/text.h"
diff --git a/src/mongo/util/exit.cpp b/src/mongo/util/exit.cpp
index 5057aaa1498..9bf0fcfe5b3 100644
--- a/src/mongo/util/exit.cpp
+++ b/src/mongo/util/exit.cpp
@@ -41,7 +41,6 @@
#include "mongo/platform/mutex.h"
#include "mongo/stdx/condition_variable.h"
#include "mongo/stdx/thread.h"
-#include "mongo/util/log.h"
#include "mongo/util/quick_exit.h"
namespace mongo {
diff --git a/src/mongo/util/fail_point.cpp b/src/mongo/util/fail_point.cpp
index 26a02782f09..f439cdd1fbb 100644
--- a/src/mongo/util/fail_point.cpp
+++ b/src/mongo/util/fail_point.cpp
@@ -46,7 +46,6 @@
#include "mongo/stdx/thread.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/fail_point_server_parameter_gen.h"
-#include "mongo/util/log.h"
#include "mongo/util/time_support.h"
namespace mongo {
diff --git a/src/mongo/util/file.cpp b/src/mongo/util/file.cpp
index 226592485bd..6b0fe3c00af 100644
--- a/src/mongo/util/file.cpp
+++ b/src/mongo/util/file.cpp
@@ -47,7 +47,6 @@
#include "mongo/platform/basic.h"
#include "mongo/util/allocator.h"
#include "mongo/util/assert_util.h"
-#include "mongo/util/log.h"
#include "mongo/util/str.h"
#include "mongo/util/text.h"
diff --git a/src/mongo/util/heap_profiler.cpp b/src/mongo/util/heap_profiler.cpp
index 7d02ed21cc5..118dd6bc116 100644
--- a/src/mongo/util/heap_profiler.cpp
+++ b/src/mongo/util/heap_profiler.cpp
@@ -39,7 +39,6 @@
#include "mongo/config.h"
#include "mongo/db/commands/server_status.h"
#include "mongo/logv2/log.h"
-#include "mongo/util/log.h"
#include "mongo/util/stacktrace.h"
#include "mongo/util/tcmalloc_parameters_gen.h"
diff --git a/src/mongo/util/net/hostname_canonicalization.cpp b/src/mongo/util/net/hostname_canonicalization.cpp
index 0e9f06d7e3c..2743cf20539 100644
--- a/src/mongo/util/net/hostname_canonicalization.cpp
+++ b/src/mongo/util/net/hostname_canonicalization.cpp
@@ -42,7 +42,6 @@
#endif
#include "mongo/logv2/log.h"
-#include "mongo/util/log.h"
#include "mongo/util/net/sockaddr.h"
#include "mongo/util/scopeguard.h"
#include "mongo/util/text.h"
diff --git a/src/mongo/util/net/http_client_curl.cpp b/src/mongo/util/net/http_client_curl.cpp
index bddb5fb910f..853b9699552 100644
--- a/src/mongo/util/net/http_client_curl.cpp
+++ b/src/mongo/util/net/http_client_curl.cpp
@@ -46,7 +46,6 @@
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/platform/mutex.h"
#include "mongo/util/assert_util.h"
-#include "mongo/util/log.h"
#include "mongo/util/net/http_client.h"
namespace mongo {
diff --git a/src/mongo/util/net/http_client_winhttp.cpp b/src/mongo/util/net/http_client_winhttp.cpp
index 1a54d4be355..4401059d23e 100644
--- a/src/mongo/util/net/http_client_winhttp.cpp
+++ b/src/mongo/util/net/http_client_winhttp.cpp
@@ -49,7 +49,6 @@
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/errno_util.h"
-#include "mongo/util/log.h"
#include "mongo/util/net/http_client.h"
#include "mongo/util/scopeguard.h"
#include "mongo/util/str.h"
diff --git a/src/mongo/util/net/openssl_init.cpp b/src/mongo/util/net/openssl_init.cpp
index 60096c06756..0256e26941b 100644
--- a/src/mongo/util/net/openssl_init.cpp
+++ b/src/mongo/util/net/openssl_init.cpp
@@ -34,7 +34,6 @@
#include "mongo/base/init.h"
#include "mongo/config.h"
#include "mongo/logv2/log.h"
-#include "mongo/util/log.h"
#include "mongo/util/net/ssl_manager.h"
#include "mongo/util/net/ssl_options.h"
diff --git a/src/mongo/util/net/private/ssl_expiration.cpp b/src/mongo/util/net/private/ssl_expiration.cpp
index 1e00f07b0d0..f43b4e9411a 100644
--- a/src/mongo/util/net/private/ssl_expiration.cpp
+++ b/src/mongo/util/net/private/ssl_expiration.cpp
@@ -34,7 +34,6 @@
#include <string>
#include "mongo/logv2/log.h"
-#include "mongo/util/log.h"
#include "mongo/util/time_support.h"
namespace mongo {
diff --git a/src/mongo/util/net/socket_utils.cpp b/src/mongo/util/net/socket_utils.cpp
index 42c2e38eac8..d286e81eea3 100644
--- a/src/mongo/util/net/socket_utils.cpp
+++ b/src/mongo/util/net/socket_utils.cpp
@@ -57,7 +57,7 @@
#include "mongo/logv2/log.h"
#include "mongo/util/concurrency/value.h"
#include "mongo/util/errno_util.h"
-#include "mongo/util/log.h"
+#include "mongo/util/exit_code.h"
#include "mongo/util/net/sockaddr.h"
#include "mongo/util/quick_exit.h"
#include "mongo/util/str.h"
diff --git a/src/mongo/util/net/ssl_manager.cpp b/src/mongo/util/net/ssl_manager.cpp
index fd888831e5c..62158cdb7b1 100644
--- a/src/mongo/util/net/ssl_manager.cpp
+++ b/src/mongo/util/net/ssl_manager.cpp
@@ -47,7 +47,6 @@
#include "mongo/transport/session.h"
#include "mongo/util/hex.h"
#include "mongo/util/icu.h"
-#include "mongo/util/log.h"
#include "mongo/util/net/ssl_options.h"
#include "mongo/util/net/ssl_parameters_gen.h"
#include "mongo/util/str.h"
diff --git a/src/mongo/util/net/ssl_manager_apple.cpp b/src/mongo/util/net/ssl_manager_apple.cpp
index 15d71d5ac73..2ddf23cd7ed 100644
--- a/src/mongo/util/net/ssl_manager_apple.cpp
+++ b/src/mongo/util/net/ssl_manager_apple.cpp
@@ -47,7 +47,6 @@
#include "mongo/platform/random.h"
#include "mongo/util/base64.h"
#include "mongo/util/concurrency/mutex.h"
-#include "mongo/util/log.h"
#include "mongo/util/net/cidr.h"
#include "mongo/util/net/private/ssl_expiration.h"
#include "mongo/util/net/socket_exception.h"
diff --git a/src/mongo/util/net/ssl_manager_openssl.cpp b/src/mongo/util/net/ssl_manager_openssl.cpp
index 1a992f66b44..5627dafadc9 100644
--- a/src/mongo/util/net/ssl_manager_openssl.cpp
+++ b/src/mongo/util/net/ssl_manager_openssl.cpp
@@ -55,7 +55,6 @@
#include "mongo/util/debug_util.h"
#include "mongo/util/exit.h"
#include "mongo/util/fail_point.h"
-#include "mongo/util/log.h"
#include "mongo/util/net/cidr.h"
#include "mongo/util/net/dh_openssl.h"
#include "mongo/util/net/ocsp/ocsp_manager.h"
@@ -1752,18 +1751,18 @@ bool SSLManagerOpenSSL::_parseAndValidateCertificate(const std::string& keyFile,
if (serverCertificateExpirationDate != nullptr) {
auto notBeforeMillis = convertASN1ToMillis(X509_get_notBefore(x509));
if (notBeforeMillis == Date_t()) {
- error() << "date conversion failed";
+ LOGV2_ERROR(23873, "date conversion failed");
return false;
}
auto notAfterMillis = convertASN1ToMillis(X509_get_notAfter(x509));
if (notAfterMillis == Date_t()) {
- error() << "date conversion failed";
+ LOGV2_ERROR(23874, "date conversion failed");
return false;
}
if ((notBeforeMillis > Date_t::now()) || (Date_t::now() > notAfterMillis)) {
- severe() << "The provided SSL certificate is expired or not yet valid.";
+ LOGV2_FATAL(23875, "The provided SSL certificate is expired or not yet valid.");
fassertFailedNoTrace(28652);
}
diff --git a/src/mongo/util/net/ssl_manager_test.cpp b/src/mongo/util/net/ssl_manager_test.cpp
index c5c05ff5bf3..5815da8f5ad 100644
--- a/src/mongo/util/net/ssl_manager_test.cpp
+++ b/src/mongo/util/net/ssl_manager_test.cpp
@@ -36,7 +36,6 @@
#include "mongo/config.h"
#include "mongo/logv2/log.h"
#include "mongo/unittest/unittest.h"
-#include "mongo/util/log.h"
#if MONGO_CONFIG_SSL_PROVIDER == MONGO_CONFIG_SSL_PROVIDER_OPENSSL
#include "mongo/util/net/dh_openssl.h"
diff --git a/src/mongo/util/net/ssl_manager_windows.cpp b/src/mongo/util/net/ssl_manager_windows.cpp
index c20531769e1..11fc3a39bec 100644
--- a/src/mongo/util/net/ssl_manager_windows.cpp
+++ b/src/mongo/util/net/ssl_manager_windows.cpp
@@ -53,7 +53,6 @@
#include "mongo/util/debug_util.h"
#include "mongo/util/exit.h"
#include "mongo/util/hex.h"
-#include "mongo/util/log.h"
#include "mongo/util/net/private/ssl_expiration.h"
#include "mongo/util/net/sockaddr.h"
#include "mongo/util/net/socket_exception.h"
diff --git a/src/mongo/util/net/ssl_options.cpp b/src/mongo/util/net/ssl_options.cpp
index 30389860a29..973f566c8ba 100644
--- a/src/mongo/util/net/ssl_options.cpp
+++ b/src/mongo/util/net/ssl_options.cpp
@@ -39,7 +39,6 @@
#include "mongo/config.h"
#include "mongo/db/server_options.h"
#include "mongo/util/hex.h"
-#include "mongo/util/log.h"
#include "mongo/util/options_parser/startup_options.h"
#include "mongo/util/text.h"
diff --git a/src/mongo/util/net/ssl_options_server.cpp b/src/mongo/util/net/ssl_options_server.cpp
index 56b0be72190..b3f2e892a90 100644
--- a/src/mongo/util/net/ssl_options_server.cpp
+++ b/src/mongo/util/net/ssl_options_server.cpp
@@ -39,7 +39,6 @@
#include "mongo/config.h"
#include "mongo/db/server_options.h"
#include "mongo/logv2/log.h"
-#include "mongo/util/log.h"
#include "mongo/util/options_parser/startup_option_init.h"
#include "mongo/util/options_parser/startup_options.h"
#include "mongo/util/text.h"
diff --git a/src/mongo/util/net/ssl_parameters.cpp b/src/mongo/util/net/ssl_parameters.cpp
index 92790983c70..1ebc409f0be 100644
--- a/src/mongo/util/net/ssl_parameters.cpp
+++ b/src/mongo/util/net/ssl_parameters.cpp
@@ -38,7 +38,6 @@
#include "mongo/db/auth/sasl_command_constants.h"
#include "mongo/db/server_options.h"
#include "mongo/logv2/log.h"
-#include "mongo/util/log.h"
#include "mongo/util/net/ssl_options.h"
#include "mongo/util/net/ssl_parameters_gen.h"
diff --git a/src/mongo/util/ntservice.cpp b/src/mongo/util/ntservice.cpp
index 2a51081bb4a..baae68bf70e 100644
--- a/src/mongo/util/ntservice.cpp
+++ b/src/mongo/util/ntservice.cpp
@@ -43,7 +43,6 @@
#include "mongo/stdx/thread.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/exit.h"
-#include "mongo/util/log.h"
#include "mongo/util/options_parser/environment.h"
#include "mongo/util/quick_exit.h"
#include "mongo/util/signal_handlers.h"
diff --git a/src/mongo/util/options_parser/options_parser.cpp b/src/mongo/util/options_parser/options_parser.cpp
index 5975d1e20c5..cea7a1e5792 100644
--- a/src/mongo/util/options_parser/options_parser.cpp
+++ b/src/mongo/util/options_parser/options_parser.cpp
@@ -59,7 +59,6 @@
#include "mongo/logv2/log.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/hex.h"
-#include "mongo/util/log.h"
#include "mongo/util/net/hostandport.h"
#include "mongo/util/net/http_client.h"
#include "mongo/util/options_parser/constraints.h"
diff --git a/src/mongo/util/password.cpp b/src/mongo/util/password.cpp
index a9d32b75495..dae8a0778ad 100644
--- a/src/mongo/util/password.cpp
+++ b/src/mongo/util/password.cpp
@@ -39,7 +39,7 @@
#include <termios.h>
#endif
-#include "mongo/util/log.h"
+#include "mongo/util/errno_util.h"
#include "mongo/util/password_params_gen.h"
namespace mongo {
diff --git a/src/mongo/util/perfctr_collect.cpp b/src/mongo/util/perfctr_collect.cpp
index 4fbe98dd419..9ed23370de8 100644
--- a/src/mongo/util/perfctr_collect.cpp
+++ b/src/mongo/util/perfctr_collect.cpp
@@ -35,7 +35,7 @@
#include "mongo/base/init.h"
#include "mongo/bson/bsonobjbuilder.h"
-#include "mongo/util/log.h"
+#include "mongo/util/errno_util.h"
#include "mongo/util/scopeguard.h"
#include "mongo/util/str.h"
#include "mongo/util/text.h"
diff --git a/src/mongo/util/perfctr_collect_test.cpp b/src/mongo/util/perfctr_collect_test.cpp
index 869f72f9e20..12776ffa62b 100644
--- a/src/mongo/util/perfctr_collect_test.cpp
+++ b/src/mongo/util/perfctr_collect_test.cpp
@@ -39,7 +39,6 @@
#include "mongo/bson/bsonobj.h"
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/unittest/unittest.h"
-#include "mongo/util/log.h"
namespace mongo {
diff --git a/src/mongo/util/periodic_runner_impl.cpp b/src/mongo/util/periodic_runner_impl.cpp
index 182e8ad7837..59a57470552 100644
--- a/src/mongo/util/periodic_runner_impl.cpp
+++ b/src/mongo/util/periodic_runner_impl.cpp
@@ -37,7 +37,6 @@
#include "mongo/db/service_context.h"
#include "mongo/logv2/log.h"
#include "mongo/util/clock_source.h"
-#include "mongo/util/log.h"
#include "mongo/util/scopeguard.h"
namespace mongo {
diff --git a/src/mongo/util/platform_init.cpp b/src/mongo/util/platform_init.cpp
index 0299d467f33..a633c428232 100644
--- a/src/mongo/util/platform_init.cpp
+++ b/src/mongo/util/platform_init.cpp
@@ -40,7 +40,6 @@
#include "mongo/base/init.h"
#include "mongo/logv2/log.h"
-#include "mongo/util/log.h"
#include "mongo/util/stacktrace.h"
#ifdef _WIN32
diff --git a/src/mongo/util/processinfo.cpp b/src/mongo/util/processinfo.cpp
index 9501f0eefcf..8af73cfa258 100644
--- a/src/mongo/util/processinfo.cpp
+++ b/src/mongo/util/processinfo.cpp
@@ -40,7 +40,6 @@
#include <iostream>
#include "mongo/logv2/log.h"
-#include "mongo/util/log.h"
namespace mongo {
diff --git a/src/mongo/util/processinfo_freebsd.cpp b/src/mongo/util/processinfo_freebsd.cpp
index ec6c732497c..70ae9698ecc 100644
--- a/src/mongo/util/processinfo_freebsd.cpp
+++ b/src/mongo/util/processinfo_freebsd.cpp
@@ -44,7 +44,6 @@
#include <vm/vm_param.h>
#include "mongo/logv2/log.h"
-#include "mongo/util/log.h"
#include "mongo/util/scopeguard.h"
#include "processinfo.h"
diff --git a/src/mongo/util/processinfo_linux.cpp b/src/mongo/util/processinfo_linux.cpp
index dde30376ce2..cbf5be2448f 100644
--- a/src/mongo/util/processinfo_linux.cpp
+++ b/src/mongo/util/processinfo_linux.cpp
@@ -56,7 +56,6 @@
#include "mongo/logv2/log.h"
#include "mongo/util/file.h"
-#include "mongo/util/log.h"
#define KLONG long
#define KLF "l"
diff --git a/src/mongo/util/processinfo_openbsd.cpp b/src/mongo/util/processinfo_openbsd.cpp
index d358a7a797c..4cc317d2e50 100644
--- a/src/mongo/util/processinfo_openbsd.cpp
+++ b/src/mongo/util/processinfo_openbsd.cpp
@@ -43,7 +43,6 @@
#include <unistd.h>
#include "mongo/logv2/log.h"
-#include "mongo/util/log.h"
#include "mongo/util/scopeguard.h"
#include "processinfo.h"
diff --git a/src/mongo/util/processinfo_osx.cpp b/src/mongo/util/processinfo_osx.cpp
index 3bc13439d16..aa018e3f985 100644
--- a/src/mongo/util/processinfo_osx.cpp
+++ b/src/mongo/util/processinfo_osx.cpp
@@ -49,7 +49,6 @@
#include "mongo/db/jsobj.h"
#include "mongo/logv2/log.h"
-#include "mongo/util/log.h"
#include "mongo/util/processinfo.h"
namespace mongo {
diff --git a/src/mongo/util/processinfo_solaris.cpp b/src/mongo/util/processinfo_solaris.cpp
index d20328c9cae..fd52e6d5fe3 100644
--- a/src/mongo/util/processinfo_solaris.cpp
+++ b/src/mongo/util/processinfo_solaris.cpp
@@ -47,7 +47,6 @@
#include "mongo/logv2/log.h"
#include "mongo/util/file.h"
-#include "mongo/util/log.h"
#include "mongo/util/processinfo.h"
#include "mongo/util/scopeguard.h"
#include "mongo/util/str.h"
diff --git a/src/mongo/util/processinfo_windows.cpp b/src/mongo/util/processinfo_windows.cpp
index dd73eb49f81..a5e18cb0a5e 100644
--- a/src/mongo/util/processinfo_windows.cpp
+++ b/src/mongo/util/processinfo_windows.cpp
@@ -38,7 +38,6 @@
#include <psapi.h>
#include "mongo/logv2/log.h"
-#include "mongo/util/log.h"
#include "mongo/util/processinfo.h"
namespace mongo {
diff --git a/src/mongo/util/procparser.cpp b/src/mongo/util/procparser.cpp
index 78e1a244155..45c8effbf4f 100644
--- a/src/mongo/util/procparser.cpp
+++ b/src/mongo/util/procparser.cpp
@@ -50,7 +50,7 @@
#include "mongo/base/status_with.h"
#include "mongo/base/string_data.h"
#include "mongo/bson/bsonobjbuilder.h"
-#include "mongo/util/log.h"
+#include "mongo/logv2/log.h"
#include "mongo/util/scopeguard.h"
#include "mongo/util/str.h"
#include "mongo/util/text.h"
@@ -659,8 +659,10 @@ bool isInterestingDisk(const boost::filesystem::path& path) {
}
if (ec) {
- warning() << "Error checking directory '" << blockDevicePath.generic_string()
- << "': " << ec.message();
+ LOGV2_WARNING(23912,
+ "Error checking directory '{blockDevicePath_generic_string}': {ec_message}",
+ "blockDevicePath_generic_string"_attr = blockDevicePath.generic_string(),
+ "ec_message"_attr = ec.message());
return false;
}
@@ -679,13 +681,19 @@ std::vector<std::string> findPhysicalDisks(StringData sysBlockPath) {
auto statusSysBlock = boost::filesystem::status(sysBlockPathStr, ec);
if (ec) {
- warning() << "Error checking directory '" << sysBlockPathStr << "': " << ec.message();
+ LOGV2_WARNING(23913,
+ "Error checking directory '{sysBlockPathStr}': {ec_message}",
+ "sysBlockPathStr"_attr = sysBlockPathStr,
+ "ec_message"_attr = ec.message());
return {};
}
if (!(boost::filesystem::exists(statusSysBlock) &&
boost::filesystem::is_directory(statusSysBlock))) {
- warning() << "Could not find directory '" << sysBlockPathStr << "': " << ec.message();
+ LOGV2_WARNING(23914,
+ "Could not find directory '{sysBlockPathStr}': {ec_message}",
+ "sysBlockPathStr"_attr = sysBlockPathStr,
+ "ec_message"_attr = ec.message());
return {};
}
@@ -696,8 +704,10 @@ std::vector<std::string> findPhysicalDisks(StringData sysBlockPath) {
// disk device. It does not contain disk partitions.
boost::filesystem::directory_iterator di(sysBlockPathStr, ec);
if (ec) {
- warning() << "Error getting directory iterator '" << sysBlockPathStr
- << "': " << ec.message();
+ LOGV2_WARNING(23915,
+ "Error getting directory iterator '{sysBlockPathStr}': {ec_message}",
+ "sysBlockPathStr"_attr = sysBlockPathStr,
+ "ec_message"_attr = ec.message());
return {};
}
diff --git a/src/mongo/util/procparser_test.cpp b/src/mongo/util/procparser_test.cpp
index 2429b119750..4db5ff0b745 100644
--- a/src/mongo/util/procparser_test.cpp
+++ b/src/mongo/util/procparser_test.cpp
@@ -40,7 +40,6 @@
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/logv2/log.h"
#include "mongo/unittest/unittest.h"
-#include "mongo/util/log.h"
namespace mongo {
diff --git a/src/mongo/util/signal_handlers_synchronous.cpp b/src/mongo/util/signal_handlers_synchronous.cpp
index 27c12f76616..ac0df71c6ac 100644
--- a/src/mongo/util/signal_handlers_synchronous.cpp
+++ b/src/mongo/util/signal_handlers_synchronous.cpp
@@ -56,7 +56,6 @@
#include "mongo/util/debugger.h"
#include "mongo/util/exception_filter_win32.h"
#include "mongo/util/exit_code.h"
-#include "mongo/util/log.h"
#include "mongo/util/quick_exit.h"
#include "mongo/util/signal_handlers.h"
#include "mongo/util/stacktrace.h"
diff --git a/src/mongo/util/stacktrace_somap.cpp b/src/mongo/util/stacktrace_somap.cpp
index ed413603142..3c8557aa02e 100644
--- a/src/mongo/util/stacktrace_somap.cpp
+++ b/src/mongo/util/stacktrace_somap.cpp
@@ -52,8 +52,8 @@
#include "mongo/base/init.h"
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/db/jsobj.h"
+#include "mongo/logv2/log.h"
#include "mongo/util/hex.h"
-#include "mongo/util/log.h"
#include "mongo/util/str.h"
#include "mongo/util/version.h"
@@ -147,20 +147,31 @@ void processLoadSegment(const dl_phdr_info& info, const ElfW(Phdr) & phdr, BSONO
std::string quotedFileName = "\"" + str::escape(info.dlpi_name) + "\"";
if (memcmp(&eHeader.e_ident[0], ELFMAG, SELFMAG)) {
- warning() << "Bad ELF magic number in image of " << quotedFileName;
+ LOGV2_WARNING(23842,
+ "Bad ELF magic number in image of {quotedFileName}",
+ "quotedFileName"_attr = quotedFileName);
return;
}
static constexpr int kArchBits = ARCH_BITS;
if (eHeader.e_ident[EI_CLASS] != ARCH_ELFCLASS) {
- warning() << "Expected elf file class of " << quotedFileName << " to be " << ARCH_ELFCLASS
- << "(" << kArchBits << "-bit), but found " << int(eHeader.e_ident[4]);
+ LOGV2_WARNING(23843,
+ "Expected elf file class of {quotedFileName} to be "
+ "{ARCH_ELFCLASS}({kArchBits}-bit), but found {int_eHeader_e_ident_4}",
+ "quotedFileName"_attr = quotedFileName,
+ "ARCH_ELFCLASS"_attr = ARCH_ELFCLASS,
+ "kArchBits"_attr = kArchBits,
+ "int_eHeader_e_ident_4"_attr = int(eHeader.e_ident[4]));
return;
}
if (eHeader.e_ident[EI_VERSION] != EV_CURRENT) {
- warning() << "Wrong ELF version in " << quotedFileName << ". Expected " << EV_CURRENT
- << " but found " << int(eHeader.e_ident[EI_VERSION]);
+ LOGV2_WARNING(23844,
+ "Wrong ELF version in {quotedFileName}. Expected {EV_CURRENT} but found "
+ "{int_eHeader_e_ident_EI_VERSION}",
+ "quotedFileName"_attr = quotedFileName,
+ "EV_CURRENT"_attr = EV_CURRENT,
+ "int_eHeader_e_ident_EI_VERSION"_attr = int(eHeader.e_ident[EI_VERSION]));
return;
}
@@ -172,8 +183,10 @@ void processLoadSegment(const dl_phdr_info& info, const ElfW(Phdr) & phdr, BSONO
case ET_DYN:
return;
default:
- warning() << "Surprised to find " << quotedFileName << " is ELF file of type "
- << eHeader.e_type;
+ LOGV2_WARNING(23845,
+ "Surprised to find {quotedFileName} is ELF file of type {eHeader_e_type}",
+ "quotedFileName"_attr = quotedFileName,
+ "eHeader_e_type"_attr = eHeader.e_type);
return;
}
diff --git a/src/mongo/util/stacktrace_test.cpp b/src/mongo/util/stacktrace_test.cpp
index 7fb200382a2..b1d4d3b5986 100644
--- a/src/mongo/util/stacktrace_test.cpp
+++ b/src/mongo/util/stacktrace_test.cpp
@@ -54,7 +54,6 @@
#include "mongo/stdx/condition_variable.h"
#include "mongo/stdx/thread.h"
#include "mongo/unittest/unittest.h"
-#include "mongo/util/log.h"
#include "mongo/util/stacktrace.h"
#include "mongo/util/stacktrace_json.h"
diff --git a/src/mongo/util/stacktrace_threads.cpp b/src/mongo/util/stacktrace_threads.cpp
index 139c865acd5..7c36e68f592 100644
--- a/src/mongo/util/stacktrace_threads.cpp
+++ b/src/mongo/util/stacktrace_threads.cpp
@@ -59,7 +59,6 @@
#include "mongo/stdx/mutex.h"
#include "mongo/stdx/thread.h"
#include "mongo/stdx/unordered_map.h"
-#include "mongo/util/log.h"
#include "mongo/util/signal_handlers_synchronous.h"
#include "mongo/util/stacktrace_json.h"
#include "mongo/util/stacktrace_somap.h"
diff --git a/src/mongo/util/stacktrace_windows.cpp b/src/mongo/util/stacktrace_windows.cpp
index 7ad19c931c0..582c8921ff2 100644
--- a/src/mongo/util/stacktrace_windows.cpp
+++ b/src/mongo/util/stacktrace_windows.cpp
@@ -50,6 +50,7 @@
#include <vector>
#include "mongo/base/init.h"
+#include "mongo/stdx/mutex.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/concurrency/mutex.h"
#include "mongo/util/log.h"
diff --git a/src/mongo/util/string_map_test.cpp b/src/mongo/util/string_map_test.cpp
index 24bae71587c..4e8eb3d27f7 100644
--- a/src/mongo/util/string_map_test.cpp
+++ b/src/mongo/util/string_map_test.cpp
@@ -32,7 +32,6 @@
#include "mongo/unittest/unittest.h"
#include "mongo/platform/random.h"
-#include "mongo/util/log.h"
#include "mongo/util/string_map.h"
#include "mongo/util/timer.h"
diff --git a/src/mongo/util/tcmalloc_server_status_section.cpp b/src/mongo/util/tcmalloc_server_status_section.cpp
index 2f3f915016f..8897c15ae49 100644
--- a/src/mongo/util/tcmalloc_server_status_section.cpp
+++ b/src/mongo/util/tcmalloc_server_status_section.cpp
@@ -42,7 +42,6 @@
#include "mongo/db/commands/server_status.h"
#include "mongo/db/service_context.h"
#include "mongo/transport/service_entry_point.h"
-#include "mongo/util/log.h"
#include "mongo/util/tcmalloc_parameters_gen.h"
namespace mongo {
diff --git a/src/mongo/util/time_support_test.cpp b/src/mongo/util/time_support_test.cpp
index b0005e1b178..e5d2e554060 100644
--- a/src/mongo/util/time_support_test.cpp
+++ b/src/mongo/util/time_support_test.cpp
@@ -35,7 +35,7 @@
#include "mongo/base/init.h"
#include "mongo/unittest/unittest.h"
-#include "mongo/util/log.h"
+#include "mongo/util/errno_util.h"
#include "mongo/util/time_support.h"
namespace mongo {
diff --git a/src/mongo/util/version.cpp b/src/mongo/util/version.cpp
index eefe9fb4131..b589d67c257 100644
--- a/src/mongo/util/version.cpp
+++ b/src/mongo/util/version.cpp
@@ -48,7 +48,6 @@
#include "mongo/db/jsobj.h"
#include "mongo/logv2/log.h"
#include "mongo/util/assert_util.h"
-#include "mongo/util/log.h"
namespace mongo {
namespace {
diff --git a/src/mongo/util/version_impl.cpp b/src/mongo/util/version_impl.cpp
index cfd68435489..27ae1706caf 100644
--- a/src/mongo/util/version_impl.cpp
+++ b/src/mongo/util/version_impl.cpp
@@ -34,8 +34,8 @@
#include "mongo/util/version.h"
#include "mongo/base/init.h"
+#include "mongo/logv2/log.h"
#include "mongo/util/assert_util.h"
-#include "mongo/util/log.h"
#define MONGO_UTIL_VERSION_CONSTANTS_H_WHITELISTED
#include "mongo/util/version_constants.h"
@@ -89,7 +89,7 @@ public:
#error This targeted Windows version is not supported
#endif // NTDDI_VERSION
#else
- severe() << "VersionInfoInterface::targetMinOS is only available for Windows";
+ LOGV2_FATAL(23868, "VersionInfoInterface::targetMinOS is only available for Windows");
fassertFailed(40277);
#endif
}