mirror of
https://github.com/matrix-construct/construct
synced 2024-11-17 23:40:57 +01:00
ircd::server: Simplify and conform loghead format.
This commit is contained in:
parent
c7bd5687f2
commit
feaa05157e
1 changed files with 20 additions and 5 deletions
|
@ -1646,15 +1646,30 @@ ircd::server::loghead(const mutable_buffer &buf,
|
||||||
const link &link)
|
const link &link)
|
||||||
{
|
{
|
||||||
thread_local char rembuf[2][64];
|
thread_local char rembuf[2][64];
|
||||||
|
|
||||||
|
const auto local
|
||||||
|
{
|
||||||
|
link.socket?
|
||||||
|
string(rembuf[0], local_ipport(*link.socket)):
|
||||||
|
string_view{}
|
||||||
|
};
|
||||||
|
|
||||||
|
const auto remote
|
||||||
|
{
|
||||||
|
link.socket?
|
||||||
|
string(rembuf[1], remote_ipport(*link.socket)):
|
||||||
|
string_view{}
|
||||||
|
};
|
||||||
|
|
||||||
return fmt::sprintf
|
return fmt::sprintf
|
||||||
{
|
{
|
||||||
buf, "socket:%lu local[%s] remote[%s] link:%lu peer:%lu",
|
buf, "socket:%lu local:%s remote:%s link:%lu peer:%lu",
|
||||||
link.socket?
|
link.socket?
|
||||||
link.socket->id : 0UL,
|
link.socket->id : 0UL,
|
||||||
link.socket?
|
local?
|
||||||
string(rembuf[0], local_ipport(*link.socket)): string_view{"0.0.0.0"},
|
local : "0.0.0.0"_sv,
|
||||||
link.socket?
|
remote?
|
||||||
string(rembuf[0], remote_ipport(*link.socket)): string_view{"0.0.0.0"},
|
remote : "0.0.0.0"_sv,
|
||||||
link.id,
|
link.id,
|
||||||
link.peer?
|
link.peer?
|
||||||
link.peer->id: 0UL,
|
link.peer->id: 0UL,
|
||||||
|
|
Loading…
Reference in a new issue