0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-30 04:38:52 +02:00

ircd::server/net: Proper snomask on these log calls.

This commit is contained in:
Jason Volk 2018-01-15 19:28:55 -08:00
parent bf99718a0f
commit 1e0fe2b3d5
2 changed files with 27 additions and 51 deletions

View file

@ -2252,7 +2252,7 @@ noexcept try
} }
catch(const std::exception &e) catch(const std::exception &e)
{ {
log::critical("resolver::handle_reply(): %s", e.what()); log.critical("resolver::handle_reply(): %s", e.what());
throw; throw;
} }

View file

@ -62,9 +62,9 @@ ircd::server::get(const net::hostport &hostport)
if(it == nodes.end() || it->first != host(hostport)) if(it == nodes.end() || it->first != host(hostport))
{ {
auto node{create(hostport)}; auto node{create(hostport)};
log::debug("node(%p) for %s created; adding...", log.debug("node(%p) for %s created; adding...",
node.get(), node.get(),
string(hostport)); string(hostport));
const string_view key{node->remote.hostname}; const string_view key{node->remote.hostname};
it = nodes.emplace_hint(it, key, std::move(node)); it = nodes.emplace_hint(it, key, std::move(node));
@ -234,18 +234,6 @@ ircd::server::node::submit(request &request)
{ {
link &ret(link_get(request)); link &ret(link_get(request));
ret.submit(request); ret.submit(request);
log::debug("node(%p) tt:%zu tc:%zu tu:%zu wt:%zu wc:%zu wr:%zu rt:%zu rc:%zu rr:%zu",
this,
tag_total(),
tag_committed(),
tag_uncommitted(),
write_total(),
write_completed(),
write_remaining(),
read_total(),
read_completed(),
read_remaining());
} }
void void
@ -356,11 +344,11 @@ try
} }
catch(const std::exception &e) catch(const std::exception &e)
{ {
log::error("node(%p) link(%p) [%s]: open: %s", log.error("node(%p) link(%p) [%s]: open: %s",
this, this,
&link, &link,
string(remote), string(remote),
e.what()); e.what());
} }
void void
@ -378,11 +366,11 @@ try
} }
catch(const std::exception &e) catch(const std::exception &e)
{ {
log::error("node(%p) link(%p) [%s]: close: %s", log.error("node(%p) link(%p) [%s]: close: %s",
this, this,
&link, &link,
string(remote), string(remote),
e.what()); e.what());
} }
void void
@ -405,10 +393,10 @@ ircd::server::node::handle_error(link &link,
void void
ircd::server::node::del(link &link) ircd::server::node::del(link &link)
{ {
log::debug("node(%p) [%s]: removing link %p", log.debug("node(%p) [%s]: removing link %p",
this, this,
string(remote), string(remote),
&link); &link);
const auto it(std::find_if(begin(links), end(links), [&link] const auto it(std::find_if(begin(links), end(links), [&link]
(const auto &link_) (const auto &link_)
@ -629,18 +617,6 @@ ircd::server::link::submit(request &request)
queue.emplace(end(queue), request) queue.emplace(end(queue), request)
}; };
log::debug("link(%p) tt:%zu tc:%zu tu:%zu wt:%zu wc:%zu wr:%zu rt:%zu rc:%zu rr:%zu",
this,
tag_total(),
tag_committed(),
tag_uncommitted(),
write_total(),
write_completed(),
write_remaining(),
read_total(),
read_completed(),
read_remaining());
if(ready()) if(ready())
wait_writable(); wait_writable();
} }
@ -785,11 +761,11 @@ ircd::server::link::process_write(tag &tag)
{ {
if(tag.write_remaining() >= tag.write_total()) if(tag.write_remaining() >= tag.write_total())
{ {
log::debug("link(%p) starting on tag %zu of %zu: wt:%zu", log.debug("link(%p) starting on tag %zu of %zu: wt:%zu",
this, this,
tag_committed(), tag_committed(),
tag_total(), tag_total(),
tag.write_total()); tag.write_total());
} }
while(tag.write_remaining()) while(tag.write_remaining())
@ -870,7 +846,7 @@ catch(const boost::system::system_error &e)
} }
catch(const std::exception &e) catch(const std::exception &e)
{ {
log::critical("link::handle_readable(): %s", e.what()); log.critical("link::handle_readable(): %s", e.what());
assert(0); assert(0);
throw; throw;
} }
@ -985,9 +961,9 @@ ircd::server::link::discard_read()
// Shouldn't ever be hit because the read() within discard() throws // Shouldn't ever be hit because the read() within discard() throws
// the pending error like an eof. // the pending error like an eof.
log::warning("Link discarded %zu of %zu unexpected bytes", log.warning("Link discarded %zu of %zu unexpected bytes",
discard, discard,
discarded); discarded);
assert(0); assert(0);
// for non-assert builds just in case; so this doesn't get loopy with // for non-assert builds just in case; so this doesn't get loopy with