diff options
author | Gabriel Russell <gabriel.russell@mongodb.com> | 2020-02-20 12:23:12 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-02-20 21:25:37 +0000 |
commit | c7f41ef10eefdd8abb5a671a0046f55af310705c (patch) | |
tree | af697623e733b153d3d190f8f1fc90fccb3f54c2 /src/mongo/client | |
parent | 11bfeda8152267fa95bc63b4e93723845737217f (diff) | |
download | mongo-c7f41ef10eefdd8abb5a671a0046f55af310705c.tar.gz |
SERVER-45869 more automatically converted structured
Diffstat (limited to 'src/mongo/client')
-rw-r--r-- | src/mongo/client/async_client.cpp | 5 | ||||
-rw-r--r-- | src/mongo/client/server_ping_monitor.cpp | 37 |
2 files changed, 31 insertions, 11 deletions
diff --git a/src/mongo/client/async_client.cpp b/src/mongo/client/async_client.cpp index 1aceecbfd94..82a0eeff20c 100644 --- a/src/mongo/client/async_client.cpp +++ b/src/mongo/client/async_client.cpp @@ -44,6 +44,7 @@ #include "mongo/db/server_options.h" #include "mongo/db/wire_version.h" #include "mongo/executor/egress_tag_closer_manager.h" +#include "mongo/logv2/log.h" #include "mongo/rpc/factory.h" #include "mongo/rpc/get_status_from_command_result.h" #include "mongo/rpc/legacy_request_builder.h" @@ -111,7 +112,9 @@ void AsyncDBClient::_parseIsMasterResponse(BSONObj request, auto validateStatus = rpc::validateWireVersion(WireSpec::instance().outgoing, protocolSet.version); if (!validateStatus.isOK()) { - warning() << "remote host has incompatible wire version: " << validateStatus; + LOGV2_WARNING(23741, + "remote host has incompatible wire version: {validateStatus}", + "validateStatus"_attr = validateStatus); uasserted(validateStatus.code(), str::stream() << "remote host has incompatible wire version: " << validateStatus.reason()); diff --git a/src/mongo/client/server_ping_monitor.cpp b/src/mongo/client/server_ping_monitor.cpp index 47c2a8e52c4..6896a7a2aab 100644 --- a/src/mongo/client/server_ping_monitor.cpp +++ b/src/mongo/client/server_ping_monitor.cpp @@ -36,6 +36,7 @@ #include "mongo/executor/network_interface_factory.h" #include "mongo/executor/network_interface_thread_pool.h" #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" @@ -98,13 +99,19 @@ void SingleServerPingMonitor::_scheduleServerPing() { } if (ErrorCodes::isShutdownError(schedulePingHandle.getStatus().code())) { - LOG(1) << "Can't schedule ping for " << _hostAndPort << ". Executor shutdown in progress"; + LOGV2_DEBUG(23727, + 1, + "Can't schedule ping for {hostAndPort}. Executor shutdown in progress", + "hostAndPort"_attr = _hostAndPort); return; } if (!schedulePingHandle.isOK()) { - severe() << "Can't continue scheduling pings to " << _hostAndPort << " due to " - << redact(schedulePingHandle.getStatus()); + LOGV2_FATAL(23732, + "Can't continue scheduling pings to {hostAndPort} due to " + "{schedulePingHandle_getStatus}", + "hostAndPort"_attr = _hostAndPort, + "schedulePingHandle_getStatus"_attr = redact(schedulePingHandle.getStatus())); fassertFailed(31434); } @@ -149,13 +156,18 @@ void SingleServerPingMonitor::_doServerPing() { }); if (ErrorCodes::isShutdownError(remotePingHandle.getStatus().code())) { - LOG(1) << "Can't ping " << _hostAndPort << ". Executor shutdown in progress"; + LOGV2_DEBUG(23728, + 1, + "Can't ping {hostAndPort}. Executor shutdown in progress", + "hostAndPort"_attr = _hostAndPort); return; } if (!remotePingHandle.isOK()) { - severe() << "Can't continue pinging " << _hostAndPort << " due to " - << redact(remotePingHandle.getStatus()); + LOGV2_FATAL(23733, + "Can't continue pinging {hostAndPort} due to {remotePingHandle_getStatus}", + "hostAndPort"_attr = _hostAndPort, + "remotePingHandle_getStatus"_attr = redact(remotePingHandle.getStatus())); fassertFailed(31435); } @@ -228,21 +240,26 @@ void ServerPingMonitor::onServerHandshakeCompleteEvent(const sdam::ServerAddress std::make_shared<SingleServerPingMonitor>(address, _rttListener, _pingFrequency, _executor); _serverPingMonitorMap[address] = newSingleMonitor; newSingleMonitor->init(); - LOG(1) << "ServerPingMonitor is now monitoring " << address; + LOGV2_DEBUG( + 23729, 1, "ServerPingMonitor is now monitoring {address}", "address"_attr = address); } void ServerPingMonitor::onServerClosedEvent(const sdam::ServerAddress& address, OID topologyId) { stdx::lock_guard lk(_mutex); if (_isShutdown) { - LOG(1) << "ServerPingMonitor is in shutdown and will stop monitoring " << address - << " if it has not already done so."; + LOGV2_DEBUG(23730, + 1, + "ServerPingMonitor is in shutdown and will stop monitoring {address} if it has " + "not already done so.", + "address"_attr = address); return; } auto it = _serverPingMonitorMap.find(address); invariant(it != _serverPingMonitorMap.end()); it->second->drop(); _serverPingMonitorMap.erase(it); - LOG(1) << "ServerPingMonitor stopped monitoring " << address; + LOGV2_DEBUG( + 23731, 1, "ServerPingMonitor stopped monitoring {address}", "address"_attr = address); } |