diff options
author | Tommaso Tocci <tommaso.tocci@mongodb.com> | 2020-03-09 17:01:02 +0100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-10 10:09:58 +0000 |
commit | 12e88dc217d46315156a90897bd57e488e6642d0 (patch) | |
tree | ae15390f4821b3aa38e6661fcb9767732a1fec7f /src | |
parent | 17984db6c531594c00bf226804d9ab7ed6225643 (diff) | |
download | mongo-12e88dc217d46315156a90897bd57e488e6642d0.tar.gz |
SERVER-46712 Convert server_selector.cpp logs to LOGV2
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/client/sdam/server_selector.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mongo/client/sdam/server_selector.cpp b/src/mongo/client/sdam/server_selector.cpp index 94abd89ec6f..3593f7ba225 100644 --- a/src/mongo/client/sdam/server_selector.cpp +++ b/src/mongo/client/sdam/server_selector.cpp @@ -30,11 +30,11 @@ #include <algorithm> -#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kNetwork +#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kNetwork #include "mongo/client/sdam/topology_description.h" +#include "mongo/logv2/log.h" #include "mongo/platform/random.h" #include "mongo/util/fail_point.h" -#include "mongo/util/log.h" namespace mongo::sdam { MONGO_FAIL_POINT_DEFINE(serverSelectorIgnoresLatencyWindow); @@ -71,7 +71,7 @@ void SdamServerSelector::_getCandidateServers(std::vector<ServerDescriptionPtr>* if (maxOpTime && maxOpTime < criteria.minOpTime) { // ignore minOpTime const_cast<ReadPreferenceSetting&>(criteria) = ReadPreferenceSetting(criteria.pref); - log() << "ignoring minOpTime for " << criteria.toString(); + LOGV2(46712001, "Ignoring minOpTime", "readPreference"_attr = criteria); } } } @@ -218,9 +218,11 @@ void SdamServerSelector::filterTags(std::vector<ServerDescriptionPtr>* servers, return false; } } else { - log() << "invalid tags specified for server selection; tags should be specified as " - "a bson Obj: " - << it->toString(); + LOGV2_WARNING( + 46712002, + "Invalid tags specified for server selection; tags should be specified as " + "bson Objects", + "tag"_attr = *it); } ++it; } |