mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 08:42:34 +01:00
ircd::log: Tweak log format.
This commit is contained in:
parent
339e43c004
commit
ad7c6980ac
1 changed files with 25 additions and 24 deletions
|
@ -516,30 +516,31 @@ noexcept
|
|||
// Compose the prefix sequence into the buffer through stringstream
|
||||
std::stringstream s;
|
||||
pubsetbuf(s, buf);
|
||||
s << microtime(date)
|
||||
<< ' '
|
||||
<< string_view{conf.console_ansi}
|
||||
<< std::setw(8)
|
||||
<< std::right
|
||||
<< reflect(lev)
|
||||
<< (string_view{conf.console_ansi}? "\033[0m " : " ")
|
||||
// << (log.snote? log.snote : '-')
|
||||
<< std::setw(LOG_NAME_TRUNC)
|
||||
<< std::left
|
||||
<< trunc(log.name, LOG_NAME_TRUNC)
|
||||
<< ' '
|
||||
<< std::setw(5)
|
||||
<< std::right
|
||||
<< ctx::id()
|
||||
<< ' '
|
||||
<< std::setw(CTX_NAME_TRUNC)
|
||||
<< std::left
|
||||
<< trunc(ctx::name(), CTX_NAME_TRUNC)
|
||||
<< ' '
|
||||
<< std::setw(5)
|
||||
<< std::right
|
||||
<< ctx::epoch()
|
||||
<< " :";
|
||||
s
|
||||
<< microtime(date)
|
||||
<< ' '
|
||||
<< std::setw(5)
|
||||
<< std::right
|
||||
<< ctx::epoch()
|
||||
<< ' '
|
||||
<< string_view{conf.console_ansi}
|
||||
<< std::setw(8)
|
||||
<< std::right
|
||||
<< reflect(lev)
|
||||
<< (string_view{conf.console_ansi}? "\033[0m " : " ")
|
||||
// << (log.snote? log.snote : '-')
|
||||
<< std::setw(LOG_NAME_TRUNC)
|
||||
<< std::left
|
||||
<< trunc(log.name, LOG_NAME_TRUNC)
|
||||
<< ' '
|
||||
<< std::setw(5)
|
||||
<< std::right
|
||||
<< ctx::id()
|
||||
<< ' '
|
||||
<< std::setw(CTX_NAME_TRUNC)
|
||||
<< std::left
|
||||
<< trunc(ctx::name(), CTX_NAME_TRUNC)
|
||||
<< " :";
|
||||
|
||||
// Compose the user message after prefix
|
||||
const size_t pos(s.tellp());
|
||||
|
|
Loading…
Reference in a new issue