summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/isself.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/repl/isself.cpp')
-rw-r--r--src/mongo/db/repl/isself.cpp40
1 files changed, 17 insertions, 23 deletions
diff --git a/src/mongo/db/repl/isself.cpp b/src/mongo/db/repl/isself.cpp
index b4af71d7fdb..3e9c6ca26a7 100644
--- a/src/mongo/db/repl/isself.cpp
+++ b/src/mongo/db/repl/isself.cpp
@@ -121,9 +121,9 @@ std::vector<std::string> getAddrsForHost(const std::string& iporhost,
if (err) {
LOGV2_WARNING(21207,
- "getaddrinfo(\"{iporhost}\") failed: {stringifyError_err}",
- "iporhost"_attr = iporhost,
- "stringifyError_err"_attr = stringifyError(err));
+ "getaddrinfo(\"{host}\") failed: {err}",
+ "host"_attr = iporhost,
+ "err"_attr = stringifyError(err));
return out;
}
@@ -137,9 +137,8 @@ std::vector<std::string> getAddrsForHost(const std::string& iporhost,
err = getnameinfo(
addr->ai_addr, addr->ai_addrlen, host, NI_MAXHOST, nullptr, 0, NI_NUMERICHOST);
if (err) {
- LOGV2_WARNING(21208,
- "getnameinfo() failed: {stringifyError_err}",
- "stringifyError_err"_attr = stringifyError(err));
+ LOGV2_WARNING(
+ 21208, "getnameinfo() failed: {err}", "err"_attr = stringifyError(err));
continue;
}
out.push_back(host);
@@ -152,7 +151,7 @@ std::vector<std::string> getAddrsForHost(const std::string& iporhost,
for (std::vector<std::string>::const_iterator o = out.begin(); o != out.end(); ++o) {
builder << " [ " << *o << "]";
}
- LOGV2_DEBUG(21205, 2, "{builder_str}", "builder_str"_attr = builder.str());
+ LOGV2_DEBUG(21205, 2, "{msg}", "msg"_attr = builder.str());
}
return out;
@@ -216,9 +215,9 @@ bool isSelf(const HostAndPort& hostAndPort, ServiceContext* const ctx) {
return me;
} catch (const std::exception& e) {
LOGV2_WARNING(21209,
- "couldn't check isSelf ({hostAndPort}) {e_what}",
+ "couldn't check isSelf ({hostAndPort}) {exception}",
"hostAndPort"_attr = hostAndPort,
- "e_what"_attr = e.what());
+ "exception"_attr = e.what());
}
return false;
@@ -237,9 +236,7 @@ std::vector<std::string> getBoundAddrs(const bool ipv6enabled) {
int err = getifaddrs(&addrs);
if (err) {
- LOGV2_WARNING(21210,
- "getifaddrs failure: {errnoWithDescription_err}",
- "errnoWithDescription_err"_attr = errnoWithDescription(err));
+ LOGV2_WARNING(21210, "getifaddrs failure: {err}", "err"_attr = errnoWithDescription(err));
return out;
}
ON_BLOCK_EXIT([&] { freeifaddrs(addrs); });
@@ -261,9 +258,7 @@ std::vector<std::string> getBoundAddrs(const bool ipv6enabled) {
0,
NI_NUMERICHOST);
if (err) {
- LOGV2_WARNING(21211,
- "getnameinfo() failed: {gai_strerror_err}",
- "gai_strerror_err"_attr = gai_strerror(err));
+ LOGV2_WARNING(21211, "getnameinfo() failed: {err}", "err"_attr = gai_strerror(err));
continue;
}
out.push_back(host);
@@ -300,9 +295,8 @@ std::vector<std::string> getBoundAddrs(const bool ipv6enabled) {
}
if (err != NO_ERROR) {
- LOGV2_WARNING(21212,
- "GetAdaptersAddresses() failed: {errnoWithDescription_err}",
- "errnoWithDescription_err"_attr = errnoWithDescription(err));
+ LOGV2_WARNING(
+ 21212, "GetAdaptersAddresses() failed: {err}", "err"_attr = errnoWithDescription(err));
return out;
}
@@ -321,8 +315,8 @@ std::vector<std::string> getBoundAddrs(const bool ipv6enabled) {
AF_INET, &(sock->sin_addr), addrstr, INET_ADDRSTRLEN, 0, ec);
if (ec) {
LOGV2_WARNING(21213,
- "inet_ntop failed during IPv4 address conversion: {ec_message}",
- "ec_message"_attr = ec.message());
+ "inet_ntop failed during IPv4 address conversion: {message}",
+ "message"_attr = ec.message());
continue;
}
out.push_back(addrstr);
@@ -335,8 +329,8 @@ std::vector<std::string> getBoundAddrs(const bool ipv6enabled) {
AF_INET6, &(sock->sin6_addr), addrstr, INET6_ADDRSTRLEN, 0, ec);
if (ec) {
LOGV2_WARNING(21214,
- "inet_ntop failed during IPv6 address conversion: {ec_message}",
- "ec_message"_attr = ec.message());
+ "inet_ntop failed during IPv6 address conversion: {message}",
+ "message"_attr = ec.message());
continue;
}
out.push_back(addrstr);
@@ -352,7 +346,7 @@ std::vector<std::string> getBoundAddrs(const bool ipv6enabled) {
for (std::vector<std::string>::const_iterator o = out.begin(); o != out.end(); ++o) {
builder << " [ " << *o << "]";
}
- LOGV2_DEBUG(21206, 2, "{builder_str}", "builder_str"_attr = builder.str());
+ LOGV2_DEBUG(21206, 2, "{msg}", "msg"_attr = builder.str());
}
return out;
}