Move logs::channel registration out of the constructor

Allow constinit initialization of logs::channel.
This commit is contained in:
Nekotekina 2020-02-02 14:09:20 +03:00
parent e57c01907e
commit 87a5dd66ab
3 changed files with 22 additions and 8 deletions

View file

@ -267,13 +267,11 @@ void logs::listener::add(logs::listener* _new)
}
}
logs::channel::channel(const char* name)
: name(name)
, enabled(level::notice)
logs::registerer::registerer(channel& _ch)
{
std::lock_guard lock(g_mutex);
get_logger()->channels.emplace(name, this);
get_logger()->channels.emplace(_ch.name, &_ch);
}
void logs::message::broadcast(const char* fmt, const fmt_type_info* sup, ...) const