mirror of
https://github.com/matrix-construct/construct
synced 2025-03-14 05:20:17 +01:00
ircd::db: Prevent copying log message if unnecessary.
This commit is contained in:
parent
599831f680
commit
b5168eb063
1 changed files with 11 additions and 3 deletions
14
ircd/db.cc
14
ircd/db.cc
|
@ -2087,12 +2087,20 @@ noexcept
|
|||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
|
||||
void
|
||||
ircd::db::database::logger::Logv(const rocksdb::InfoLogLevel level,
|
||||
ircd::db::database::logger::Logv(const rocksdb::InfoLogLevel level_,
|
||||
const char *const fmt,
|
||||
va_list ap)
|
||||
noexcept
|
||||
{
|
||||
if(level < GetInfoLogLevel())
|
||||
if(level_ < GetInfoLogLevel())
|
||||
return;
|
||||
|
||||
const log::level level
|
||||
{
|
||||
translate(level_)
|
||||
};
|
||||
|
||||
if(level > RB_LOG_LEVEL)
|
||||
return;
|
||||
|
||||
thread_local char buf[1024]; const auto len
|
||||
|
@ -2110,7 +2118,7 @@ noexcept
|
|||
if(startswith(str, "Options"))
|
||||
return;
|
||||
|
||||
rog(translate(level), "'%s': %s", d->name, str);
|
||||
rog(level, "'%s': %s", d->name, str);
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue