0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 02:02:38 +01:00

ircd::log: Skip some operations for log levels not compiled in.

This commit is contained in:
Jason Volk 2018-12-22 17:16:17 -08:00
parent c2b344b74e
commit 8e8602e08a

View file

@ -78,6 +78,9 @@ ircd::log::open()
{
for_each<level>([](const level &lev)
{
if(lev > RB_LOG_LEVEL)
return;
const auto &conf(confs.at(lev));
if(!bool(conf.file_enable))
return;
@ -96,6 +99,9 @@ ircd::log::close()
{
for_each<level>([](const level &lev)
{
if(lev > RB_LOG_LEVEL)
return;
if(file[lev].is_open())
file[lev].close();
});
@ -106,6 +112,9 @@ ircd::log::flush()
{
for_each<level>([](const level &lev)
{
if(lev > RB_LOG_LEVEL)
return;
file[lev].flush();
});
@ -238,6 +247,9 @@ ircd::log::mark::mark(const string_view &msg)
for_each<level>([&msg]
(const auto &lev)
{
if(lev > RB_LOG_LEVEL)
return;
mark(lev, msg);
});
}