diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2020-02-26 15:39:55 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2020-02-26 15:39:55 +0000 |
commit | ce4f6d6f6e0be8478e1f2f6f728dcc89f4b1e271 (patch) | |
tree | ab403b1b448488a2e9881551fdae0eae4ad157da /src/mongo/db/repl/isself.cpp | |
parent | dbc00195a18a3aecbcb7b254c3de2056fe25aa24 (diff) | |
download | mongo-ce4f6d6f6e0be8478e1f2f6f728dcc89f4b1e271.tar.gz |
SERVER-46074 Improve log attributes for repl directory and bridge.cpp
Diffstat (limited to 'src/mongo/db/repl/isself.cpp')
-rw-r--r-- | src/mongo/db/repl/isself.cpp | 40 |
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; } |