diff options
author | Gabriel Russell <gabriel.russell@mongodb.com> | 2020-02-20 16:05:48 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-02-21 20:12:44 +0000 |
commit | 0f7625b5cdbc24ed0fce1e168059118cb025d869 (patch) | |
tree | 3ea90b71ed2510e220140626b351f6e998d2d8b7 /src/mongo/client | |
parent | 3463ea25afcbf2c07b96f043904961b5c0f04474 (diff) | |
download | mongo-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/client')
29 files changed, 34 insertions, 42 deletions
diff --git a/src/mongo/client/async_client.cpp b/src/mongo/client/async_client.cpp index 82a0eeff20c..829d557e44e 100644 --- a/src/mongo/client/async_client.cpp +++ b/src/mongo/client/async_client.cpp @@ -50,7 +50,6 @@ #include "mongo/rpc/legacy_request_builder.h" #include "mongo/rpc/metadata/client_metadata.h" #include "mongo/rpc/reply_interface.h" -#include "mongo/util/log.h" #include "mongo/util/net/socket_utils.h" #include "mongo/util/net/ssl_manager.h" #include "mongo/util/version.h" diff --git a/src/mongo/client/authenticate.cpp b/src/mongo/client/authenticate.cpp index 9136aa19ac7..8d4a2dc05ab 100644 --- a/src/mongo/client/authenticate.cpp +++ b/src/mongo/client/authenticate.cpp @@ -46,7 +46,6 @@ #include "mongo/platform/mutex.h" #include "mongo/rpc/get_status_from_command_result.h" #include "mongo/rpc/op_msg_rpc_impls.h" -#include "mongo/util/log.h" #include "mongo/util/net/ssl_manager.h" #include "mongo/util/net/ssl_options.h" #include "mongo/util/password_digest.h" diff --git a/src/mongo/client/connection_string_connect.cpp b/src/mongo/client/connection_string_connect.cpp index 229495c3a0e..935888d3e4a 100644 --- a/src/mongo/client/connection_string_connect.cpp +++ b/src/mongo/client/connection_string_connect.cpp @@ -40,7 +40,6 @@ #include "mongo/client/mongo_uri.h" #include "mongo/logv2/log.h" #include "mongo/util/assert_util.h" -#include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/client/dbclient_base.cpp b/src/mongo/client/dbclient_base.cpp index 7d91816a066..caad3d6cc98 100644 --- a/src/mongo/client/dbclient_base.cpp +++ b/src/mongo/client/dbclient_base.cpp @@ -67,7 +67,6 @@ #include "mongo/util/assert_util.h" #include "mongo/util/concurrency/mutex.h" #include "mongo/util/debug_util.h" -#include "mongo/util/log.h" #include "mongo/util/net/ssl_manager.h" #include "mongo/util/net/ssl_options.h" #include "mongo/util/password_digest.h" diff --git a/src/mongo/client/dbclient_connection.cpp b/src/mongo/client/dbclient_connection.cpp index c7e2a18021c..e39fcec61c7 100644 --- a/src/mongo/client/dbclient_connection.cpp +++ b/src/mongo/client/dbclient_connection.cpp @@ -73,7 +73,6 @@ #include "mongo/util/assert_util.h" #include "mongo/util/concurrency/mutex.h" #include "mongo/util/debug_util.h" -#include "mongo/util/log.h" #include "mongo/util/net/socket_exception.h" #include "mongo/util/net/socket_utils.h" #include "mongo/util/net/ssl_manager.h" diff --git a/src/mongo/client/dbclient_cursor.cpp b/src/mongo/client/dbclient_cursor.cpp index 4fa665c5e14..7af7d314769 100644 --- a/src/mongo/client/dbclient_cursor.cpp +++ b/src/mongo/client/dbclient_cursor.cpp @@ -56,7 +56,6 @@ #include "mongo/util/debug_util.h" #include "mongo/util/destructor_guard.h" #include "mongo/util/exit.h" -#include "mongo/util/log.h" #include "mongo/util/scopeguard.h" namespace mongo { diff --git a/src/mongo/client/dbclient_cursor_test.cpp b/src/mongo/client/dbclient_cursor_test.cpp index 41641170333..ae4970f7895 100644 --- a/src/mongo/client/dbclient_cursor_test.cpp +++ b/src/mongo/client/dbclient_cursor_test.cpp @@ -35,7 +35,6 @@ #include "mongo/logv2/log.h" #include "mongo/unittest/unittest.h" #include "mongo/util/assert_util.h" -#include "mongo/util/log.h" namespace mongo { namespace { diff --git a/src/mongo/client/dbclient_rs.cpp b/src/mongo/client/dbclient_rs.cpp index b71f63fa2ec..126b7d5f03b 100644 --- a/src/mongo/client/dbclient_rs.cpp +++ b/src/mongo/client/dbclient_rs.cpp @@ -46,7 +46,6 @@ #include "mongo/db/dbmessage.h" #include "mongo/db/jsobj.h" #include "mongo/logv2/log.h" -#include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/client/fetcher.cpp b/src/mongo/client/fetcher.cpp index df0bfb41077..4fe470bf4f4 100644 --- a/src/mongo/client/fetcher.cpp +++ b/src/mongo/client/fetcher.cpp @@ -37,10 +37,11 @@ #include "mongo/db/jsobj.h" #include "mongo/db/namespace_string.h" +#include "mongo/logger/redaction.h" +#include "mongo/logv2/log.h" #include "mongo/rpc/get_status_from_command_result.h" #include "mongo/util/assert_util.h" #include "mongo/util/destructor_guard.h" -#include "mongo/util/log.h" #include "mongo/util/scopeguard.h" #include "mongo/util/str.h" @@ -391,20 +392,24 @@ void Fetcher::_sendKillCursors(const CursorId id, const NamespaceString& nss) { if (id) { auto logKillCursorsResult = [](const RemoteCommandCallbackArgs& args) { if (!args.response.isOK()) { - warning() << "killCursors command task failed: " << redact(args.response.status); + LOGV2_WARNING(23918, + "killCursors command task failed: {args_response_status}", + "args_response_status"_attr = redact(args.response.status)); return; } auto status = getStatusFromCommandResult(args.response.data); if (!status.isOK()) { - warning() << "killCursors command failed: " << redact(status); + LOGV2_WARNING( + 23919, "killCursors command failed: {status}", "status"_attr = redact(status)); } }; auto cmdObj = BSON("killCursors" << nss.coll() << "cursors" << BSON_ARRAY(id)); auto scheduleResult = _executor->scheduleRemoteCommand( RemoteCommandRequest(_source, _dbname, cmdObj, nullptr), logKillCursorsResult); if (!scheduleResult.isOK()) { - warning() << "failed to schedule killCursors command: " - << redact(scheduleResult.getStatus()); + LOGV2_WARNING(23920, + "failed to schedule killCursors command: {scheduleResult_getStatus}", + "scheduleResult_getStatus"_attr = redact(scheduleResult.getStatus())); } } } diff --git a/src/mongo/client/mongo_uri_test.cpp b/src/mongo/client/mongo_uri_test.cpp index badc6cf3a96..aadd46b3a6a 100644 --- a/src/mongo/client/mongo_uri_test.cpp +++ b/src/mongo/client/mongo_uri_test.cpp @@ -42,7 +42,6 @@ #include "mongo/unittest/unittest.h" #include "mongo/logv2/log.h" -#include "mongo/util/log.h" #include <boost/filesystem/operations.hpp> #include <boost/optional.hpp> #include <boost/optional/optional_io.hpp> diff --git a/src/mongo/client/remote_command_retry_scheduler.cpp b/src/mongo/client/remote_command_retry_scheduler.cpp index d6f50082078..a170d68dd28 100644 --- a/src/mongo/client/remote_command_retry_scheduler.cpp +++ b/src/mongo/client/remote_command_retry_scheduler.cpp @@ -38,7 +38,6 @@ #include "mongo/client/remote_command_retry_scheduler.h" #include "mongo/util/assert_util.h" #include "mongo/util/destructor_guard.h" -#include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/client/remote_command_retry_scheduler_test.cpp b/src/mongo/client/remote_command_retry_scheduler_test.cpp index 03bcbd44fe8..b631e542f79 100644 --- a/src/mongo/client/remote_command_retry_scheduler_test.cpp +++ b/src/mongo/client/remote_command_retry_scheduler_test.cpp @@ -45,7 +45,6 @@ #include "mongo/unittest/task_executor_proxy.h" #include "mongo/unittest/unittest.h" #include "mongo/util/assert_util.h" -#include "mongo/util/log.h" #include "mongo/util/net/hostandport.h" namespace { diff --git a/src/mongo/client/remote_command_targeter_rs.cpp b/src/mongo/client/remote_command_targeter_rs.cpp index d5640d3a4ae..102d059ae70 100644 --- a/src/mongo/client/remote_command_targeter_rs.cpp +++ b/src/mongo/client/remote_command_targeter_rs.cpp @@ -40,7 +40,6 @@ #include "mongo/db/operation_context.h" #include "mongo/logv2/log.h" #include "mongo/util/assert_util.h" -#include "mongo/util/log.h" #include "mongo/util/net/hostandport.h" #include "mongo/util/str.h" diff --git a/src/mongo/client/replica_set_change_notifier.cpp b/src/mongo/client/replica_set_change_notifier.cpp index b0a35057dd9..00523770718 100644 --- a/src/mongo/client/replica_set_change_notifier.cpp +++ b/src/mongo/client/replica_set_change_notifier.cpp @@ -35,7 +35,6 @@ #include "mongo/logv2/log.h" #include "mongo/util/fail_point.h" -#include "mongo/util/log.h" #include "mongo/util/stacktrace.h" namespace mongo { diff --git a/src/mongo/client/replica_set_monitor.cpp b/src/mongo/client/replica_set_monitor.cpp index e5604439330..807f0bc9f46 100644 --- a/src/mongo/client/replica_set_monitor.cpp +++ b/src/mongo/client/replica_set_monitor.cpp @@ -53,7 +53,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/string_map.h" #include "mongo/util/timer.h" diff --git a/src/mongo/client/replica_set_monitor_manager.cpp b/src/mongo/client/replica_set_monitor_manager.cpp index 8e27ca8e284..13efd98a3a9 100644 --- a/src/mongo/client/replica_set_monitor_manager.cpp +++ b/src/mongo/client/replica_set_monitor_manager.cpp @@ -48,7 +48,6 @@ #include "mongo/logv2/log.h" #include "mongo/platform/mutex.h" #include "mongo/rpc/metadata/egress_metadata_hook_list.h" -#include "mongo/util/log.h" #include "mongo/util/map_util.h" namespace mongo { diff --git a/src/mongo/client/replica_set_monitor_scan_test.cpp b/src/mongo/client/replica_set_monitor_scan_test.cpp index dfac48e56f8..2bc894f27ba 100644 --- a/src/mongo/client/replica_set_monitor_scan_test.cpp +++ b/src/mongo/client/replica_set_monitor_scan_test.cpp @@ -35,7 +35,6 @@ #include "mongo/client/mongo_uri.h" #include "mongo/logv2/log.h" -#include "mongo/util/log.h" namespace mongo { namespace { diff --git a/src/mongo/client/sasl_client_authenticate_impl.cpp b/src/mongo/client/sasl_client_authenticate_impl.cpp index f95ed39811d..0a3fdac3f12 100644 --- a/src/mongo/client/sasl_client_authenticate_impl.cpp +++ b/src/mongo/client/sasl_client_authenticate_impl.cpp @@ -51,7 +51,6 @@ #include "mongo/logv2/log.h" #include "mongo/rpc/get_status_from_command_result.h" #include "mongo/util/base64.h" -#include "mongo/util/log.h" #include "mongo/util/net/hostandport.h" #include "mongo/util/password_digest.h" diff --git a/src/mongo/client/sasl_sspi.cpp b/src/mongo/client/sasl_sspi.cpp index 3426ff3943c..86461bd6472 100644 --- a/src/mongo/client/sasl_sspi.cpp +++ b/src/mongo/client/sasl_sspi.cpp @@ -39,7 +39,7 @@ #include "mongo/base/init.h" #include "mongo/base/status.h" #include "mongo/client/sasl_sspi_options.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" @@ -210,12 +210,12 @@ int sspiClientMechNew(void* glob_context, ss << fqdn << " "; } ss << "]"; - warning() << ss.str(); + LOGV2_WARNING(23933, "{ss_str}", "ss_str"_attr = ss.str()); } canonName = std::move(fqdns.back()); fqdns.pop_back(); } else if (saslSSPIGlobalParams.canonicalization != HostnameCanonicalizationMode::kNone) { - warning() << "Was unable to acquire an FQDN"; + LOGV2_WARNING(23934, "Was unable to acquire an FQDN"); } pcctx->nameToken = toWideString(cparams->service) + L'/' + toWideString(canonName.c_str()); diff --git a/src/mongo/client/sdam/sdam_json_test_runner.cpp b/src/mongo/client/sdam/sdam_json_test_runner.cpp index ec4b8e453d2..9c750ad977b 100644 --- a/src/mongo/client/sdam/sdam_json_test_runner.cpp +++ b/src/mongo/client/sdam/sdam_json_test_runner.cpp @@ -46,7 +46,6 @@ #include "mongo/logv2/log.h" #include "mongo/stdx/unordered_set.h" #include "mongo/util/clock_source_mock.h" -#include "mongo/util/log.h" #include "mongo/util/options_parser/environment.h" #include "mongo/util/options_parser/option_section.h" #include "mongo/util/options_parser/options_parser.h" diff --git a/src/mongo/client/sdam/server_description.cpp b/src/mongo/client/sdam/server_description.cpp index 8d919251054..1674840a5a6 100644 --- a/src/mongo/client/sdam/server_description.cpp +++ b/src/mongo/client/sdam/server_description.cpp @@ -38,8 +38,8 @@ #include "mongo/bson/bsonobjbuilder.h" #include "mongo/bson/oid.h" #include "mongo/client/sdam/sdam_datatypes.h" +#include "mongo/logv2/log.h" #include "mongo/util/duration.h" -#include "mongo/util/log.h" namespace mongo::sdam { @@ -206,7 +206,9 @@ void ServerDescription::parseTypeFromIsMaster(const BSONObj isMaster) { } else if (isMaster.getBoolField("isreplicaset")) { t = ServerType::kRSGhost; } else { - error() << "unknown server type from successful ismaster reply: " << isMaster.toString(); + LOGV2_ERROR(23931, + "unknown server type from successful ismaster reply: {isMaster}", + "isMaster"_attr = isMaster.toString()); t = ServerType::kUnknown; } _type = t; diff --git a/src/mongo/client/sdam/topology_description.cpp b/src/mongo/client/sdam/topology_description.cpp index 960c0b21057..d3783719864 100644 --- a/src/mongo/client/sdam/topology_description.cpp +++ b/src/mongo/client/sdam/topology_description.cpp @@ -31,7 +31,6 @@ #define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kNetwork #include "mongo/client/sdam/server_description.h" #include "mongo/db/wire_version.h" -#include "mongo/util/log.h" namespace mongo::sdam { //////////////////////// diff --git a/src/mongo/client/sdam/topology_description_test.cpp b/src/mongo/client/sdam/topology_description_test.cpp index b5aca529bfd..9f7a6a2dbee 100644 --- a/src/mongo/client/sdam/topology_description_test.cpp +++ b/src/mongo/client/sdam/topology_description_test.cpp @@ -38,7 +38,6 @@ #include "mongo/db/wire_version.h" #include "mongo/logv2/log.h" #include "mongo/unittest/death_test.h" -#include "mongo/util/log.h" namespace mongo { template std::ostream& operator<<(std::ostream& os, diff --git a/src/mongo/client/sdam/topology_listener_mock.cpp b/src/mongo/client/sdam/topology_listener_mock.cpp index 5d5fe1db2ff..5b8bcd4a6b0 100644 --- a/src/mongo/client/sdam/topology_listener_mock.cpp +++ b/src/mongo/client/sdam/topology_listener_mock.cpp @@ -31,7 +31,6 @@ #include "mongo/platform/basic.h" #include "mongo/client/sdam/topology_listener_mock.h" -#include "mongo/util/log.h" namespace mongo::sdam { diff --git a/src/mongo/client/sdam/topology_manager.cpp b/src/mongo/client/sdam/topology_manager.cpp index 656ec9bde4d..7897e6948f7 100644 --- a/src/mongo/client/sdam/topology_manager.cpp +++ b/src/mongo/client/sdam/topology_manager.cpp @@ -32,7 +32,6 @@ #include "mongo/client/sdam/topology_state_machine.h" #include "mongo/logv2/log.h" -#include "mongo/util/log.h" namespace mongo::sdam { @@ -84,9 +83,12 @@ void TopologyManager::onServerDescription(const IsMasterOutcome& isMasterOutcome boost::optional<TopologyVersion> newTopologyVersion = isMasterOutcome.getTopologyVersion(); if (isStaleTopologyVersion(lastTopologyVersion, newTopologyVersion)) { - log() << "Ignoring this isMaster response because our topologyVersion: " - << lastTopologyVersion->toBSON() - << "is fresher than the provided topologyVersion: " << newTopologyVersion->toBSON(); + LOGV2( + 23930, + "Ignoring this isMaster response because our topologyVersion: {lastTopologyVersion}is " + "fresher than the provided topologyVersion: {newTopologyVersion}", + "lastTopologyVersion"_attr = lastTopologyVersion->toBSON(), + "newTopologyVersion"_attr = newTopologyVersion->toBSON()); return; } diff --git a/src/mongo/client/sdam/topology_manager_test.cpp b/src/mongo/client/sdam/topology_manager_test.cpp index fb0fb6a37e5..bc9e9256f1a 100644 --- a/src/mongo/client/sdam/topology_manager_test.cpp +++ b/src/mongo/client/sdam/topology_manager_test.cpp @@ -34,7 +34,6 @@ #include "mongo/client/sdam/sdam_test_base.h" #include "mongo/unittest/death_test.h" -#include "mongo/util/log.h" #include "mongo/util/system_clock_source.h" namespace mongo { diff --git a/src/mongo/client/sdam/topology_state_machine.cpp b/src/mongo/client/sdam/topology_state_machine.cpp index c54053b2260..f15e7a555d5 100644 --- a/src/mongo/client/sdam/topology_state_machine.cpp +++ b/src/mongo/client/sdam/topology_state_machine.cpp @@ -34,7 +34,6 @@ #include "mongo/client/sdam/sdam_test_base.h" #include "mongo/logv2/log.h" -#include "mongo/util/log.h" namespace mongo::sdam { TopologyStateMachine::TopologyStateMachine(const SdamConfiguration& config) : _config(config) { diff --git a/src/mongo/client/server_ping_monitor.cpp b/src/mongo/client/server_ping_monitor.cpp index 6896a7a2aab..7359b07e503 100644 --- a/src/mongo/client/server_ping_monitor.cpp +++ b/src/mongo/client/server_ping_monitor.cpp @@ -38,7 +38,6 @@ #include "mongo/executor/thread_pool_task_executor.h" #include "mongo/logv2/log.h" #include "mongo/rpc/metadata/egress_metadata_hook_list.h" -#include "mongo/util/log.h" namespace mongo { diff --git a/src/mongo/client/server_ping_monitor_test.cpp b/src/mongo/client/server_ping_monitor_test.cpp index 7025ac70894..b4a3074ce0b 100644 --- a/src/mongo/client/server_ping_monitor_test.cpp +++ b/src/mongo/client/server_ping_monitor_test.cpp @@ -41,9 +41,9 @@ #include "mongo/executor/thread_pool_mock.h" #include "mongo/executor/thread_pool_task_executor.h" #include "mongo/executor/thread_pool_task_executor_test_fixture.h" +#include "mongo/logv2/log.h" #include "mongo/unittest/unittest.h" #include "mongo/util/duration.h" -#include "mongo/util/log.h" namespace mongo { namespace { @@ -113,7 +113,10 @@ protected: // Check that it is a ping request from the expected hostAndPort. executor::TaskExecutorTest::assertRemoteCommandNameEquals("ping", request); ASSERT_EQ(request.target.toString(), hostAndPort); - LOG(0) << "at " << elapsed() << " got mock network operation " << request.toString(); + LOGV2(23925, + "at {elapsed} got mock network operation {request}", + "elapsed"_attr = elapsed(), + "request"_attr = request.toString()); const auto node = replSet->getNode(hostAndPort); node->setCommandReply("ping", BSON("ok" << 1)); @@ -132,9 +135,13 @@ protected: InNetworkGuard guard(_net); // Operations can happen inline with advanceTime(), so log before and after the call. - LOG(1) << "Advancing time from " << elapsed() << " to " << (elapsed() + d); + LOGV2_DEBUG(23926, + 1, + "Advancing time from {elapsed} to {elapsed_d}", + "elapsed"_attr = elapsed(), + "elapsed_d"_attr = (elapsed() + d)); _net->advanceTime(_net->now() + d); - LOG(1) << "Advanced to " << elapsed(); + LOGV2_DEBUG(23927, 1, "Advanced to {elapsed}", "elapsed"_attr = elapsed()); } /** |