0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-10-01 05:08:59 +02:00

ircd::net: Improve log consistency.

This commit is contained in:
Jason Volk 2019-07-18 17:13:00 -07:00
parent 83c21ea523
commit ceb9ca3db7
2 changed files with 22 additions and 22 deletions

View file

@ -1003,7 +1003,7 @@ const
thread_local char locbuf[128]; thread_local char locbuf[128];
return fmt::sprintf return fmt::sprintf
{ {
buf, "socket:%lu local[%s] remote[%s] client:%lu req:%lu:%lu", buf, "socket:%lu local:%s remote:%s client:%lu req:%lu:%lu",
sock? net::id(*sock) : -1UL, sock? net::id(*sock) : -1UL,
string(locbuf, ircd::local(*this)), string(locbuf, ircd::local(*this)),
string(rembuf, ircd::remote(*this)), string(rembuf, ircd::remote(*this)),

View file

@ -184,7 +184,7 @@ ircd::net::loghead(const mutable_buffer &out,
thread_local char buf[2][128]; thread_local char buf[2][128];
return fmt::sprintf return fmt::sprintf
{ {
out, "socket:%lu local[%s] remote[%s]", out, "socket:%lu local:%s remote:%s",
id(socket), id(socket),
string(buf[0], local_ipport(socket)), string(buf[0], local_ipport(socket)),
string(buf[1], remote_ipport(socket)), string(buf[1], remote_ipport(socket)),
@ -1689,9 +1689,9 @@ noexcept try
thread_local char ecbuf[64]; thread_local char ecbuf[64];
log::debug log::debug
{ {
log, "%s: %s accepted(%zu) %s", log, "%s %s accepted(%zu) %s",
loghead(*this),
loghead(*sock), loghead(*sock),
loghead(*this),
accepting, accepting,
string(ecbuf, ec) string(ecbuf, ec)
}; };
@ -1717,9 +1717,9 @@ noexcept try
{ {
log::dwarning log::dwarning
{ {
log, "%s: refusing to handshake %s; exceeds maximum of %zu handshakes.", log, "%s refusing to handshake %s; exceeds maximum of %zu handshakes.",
loghead(*this),
loghead(*sock), loghead(*sock),
loghead(*this),
size_t(handshaking_max), size_t(handshaking_max),
}; };
@ -1731,9 +1731,9 @@ noexcept try
{ {
log::dwarning log::dwarning
{ {
log, "%s: refusing to handshake %s; exceeds maximum of %zu handshakes to them.", log, "%s refusing to handshake %s; exceeds maximum of %zu handshakes to them.",
loghead(*this),
loghead(*sock), loghead(*sock),
loghead(*this),
size_t(handshaking_max_per_peer), size_t(handshaking_max_per_peer),
}; };
@ -1771,9 +1771,9 @@ catch(const ctx::interrupted &e)
thread_local char ecbuf[64]; thread_local char ecbuf[64];
log::debug log::debug
{ {
log, "%s: acceptor interrupted %s %s", log, "%s acceptor interrupted %s %s",
loghead(*this),
loghead(*sock), loghead(*sock),
loghead(*this),
string(ecbuf, ec) string(ecbuf, ec)
}; };
@ -1787,9 +1787,9 @@ catch(const std::system_error &e)
assert(bool(sock)); assert(bool(sock));
log::derror log::derror
{ {
log, "%s: %s in accept(): %s", log, "%s %s in accept(): %s",
loghead(*this),
loghead(*sock), loghead(*sock),
loghead(*this),
e.what() e.what()
}; };
@ -1803,9 +1803,9 @@ catch(const std::exception &e)
assert(bool(sock)); assert(bool(sock));
log::error log::error
{ {
log, "%s: %s in accept(): %s", log, "%s %s in accept(): %s",
loghead(*this),
loghead(*sock), loghead(*sock),
loghead(*this),
e.what() e.what()
}; };
@ -1865,9 +1865,9 @@ noexcept try
thread_local char ecbuf[64]; thread_local char ecbuf[64];
log::debug log::debug
{ {
log, "%s: %s handshook(%zd:%zu) cipher:%s %s", log, "%s %s handshook(%zd:%zu) cipher:%s %s",
loghead(*this),
loghead(*sock), loghead(*sock),
loghead(*this),
std::distance(cbegin(handshaking), it), std::distance(cbegin(handshaking), it),
handshaking.size(), handshaking.size(),
current_cipher? current_cipher?
@ -1892,9 +1892,9 @@ catch(const ctx::interrupted &e)
thread_local char ecbuf[64]; thread_local char ecbuf[64];
log::debug log::debug
{ {
log, "%s: SSL handshake interrupted %s %s", log, "%s SSL handshake interrupted %s %s",
loghead(*this),
loghead(*sock), loghead(*sock),
loghead(*this),
string(ecbuf, ec) string(ecbuf, ec)
}; };
@ -1906,9 +1906,9 @@ catch(const std::system_error &e)
assert(bool(sock)); assert(bool(sock));
log::derror log::derror
{ {
log, "%s: %s in handshake(): %s", log, "%s %s in handshake(): %s",
loghead(*this),
loghead(*sock), loghead(*sock),
loghead(*this),
e.what() e.what()
}; };
@ -1920,9 +1920,9 @@ catch(const std::exception &e)
assert(bool(sock)); assert(bool(sock));
log::error log::error
{ {
log, "%s: %s in handshake(): %s", log, "%s %s in handshake(): %s",
loghead(*this),
loghead(*sock), loghead(*sock),
loghead(*this),
e.what() e.what()
}; };