mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 02:02:38 +01:00
ircd::db::database::logger: Additional conditions for debug level in any build mode.
This commit is contained in:
parent
6e33d52bda
commit
17f0923eff
1 changed files with 14 additions and 9 deletions
|
@ -2167,8 +2167,7 @@ noexcept
|
||||||
return rocksdb::Status::NotSupported();
|
return rocksdb::Status::NotSupported();
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static ircd::log::level
|
||||||
ircd::log::level
|
|
||||||
translate(const rocksdb::InfoLogLevel &level)
|
translate(const rocksdb::InfoLogLevel &level)
|
||||||
{
|
{
|
||||||
switch(level)
|
switch(level)
|
||||||
|
@ -2214,15 +2213,21 @@ ircd::db::database::logger::Logv(const rocksdb::InfoLogLevel level_,
|
||||||
va_list ap)
|
va_list ap)
|
||||||
noexcept
|
noexcept
|
||||||
{
|
{
|
||||||
if(level_ < GetInfoLogLevel())
|
const bool level_pass
|
||||||
return;
|
|
||||||
|
|
||||||
const log::level level
|
|
||||||
{
|
{
|
||||||
translate(level_)
|
true
|
||||||
|
&& translate(level_) <= RB_LOG_LEVEL
|
||||||
|
&& level_ >= GetInfoLogLevel()
|
||||||
};
|
};
|
||||||
|
|
||||||
if(level > RB_LOG_LEVEL)
|
const bool pass
|
||||||
|
{
|
||||||
|
false
|
||||||
|
|| level_pass
|
||||||
|
|| ircd::debugmode
|
||||||
|
};
|
||||||
|
|
||||||
|
if(likely(!pass))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
thread_local char buf[1024]; const auto len
|
thread_local char buf[1024]; const auto len
|
||||||
|
@ -2240,7 +2245,7 @@ noexcept
|
||||||
if(startswith(str, "Options"))
|
if(startswith(str, "Options"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
rog(level, "[%s] %s", d->name, str);
|
rog(translate(level_), "[%s] %s", d->name, str);
|
||||||
}
|
}
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
#pragma clang diagnostic pop
|
#pragma clang diagnostic pop
|
||||||
|
|
Loading…
Reference in a new issue