mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-12-27 06:21:02 +00:00
Implement logs::get_level
This commit is contained in:
parent
007a7a5859
commit
e7b24461ec
@ -186,6 +186,22 @@ namespace logs
|
||||
}
|
||||
}
|
||||
|
||||
level get_level(const std::string& ch_name)
|
||||
{
|
||||
std::lock_guard lock(g_mutex);
|
||||
|
||||
auto found = get_logger()->channels.equal_range(ch_name);
|
||||
|
||||
if (found.first != found.second)
|
||||
{
|
||||
return found.first->second->enabled;
|
||||
}
|
||||
else
|
||||
{
|
||||
return level::always;
|
||||
}
|
||||
}
|
||||
|
||||
// Must be called in main() to stop accumulating messages in g_messages
|
||||
void set_init()
|
||||
{
|
||||
|
@ -92,6 +92,9 @@ namespace logs
|
||||
|
||||
// Log level control: register channel if necessary, set channel level
|
||||
void set_level(const std::string&, level);
|
||||
|
||||
// Log level control: get channel level
|
||||
level get_level(const std::string&);
|
||||
}
|
||||
|
||||
#define LOG_CHANNEL(ch, ...) inline ::logs::channel ch(#ch, ##__VA_ARGS__)
|
||||
|
Loading…
Reference in New Issue
Block a user