mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-03 17:38:15 +00:00
logs: Add manual set log level with RegEx
This commit is contained in:
parent
a98174be85
commit
e76ce05e29
@ -11,6 +11,7 @@
|
||||
#include <chrono>
|
||||
#include <cstring>
|
||||
#include <cerrno>
|
||||
#include <regex>
|
||||
|
||||
using namespace std::literals::chrono_literals;
|
||||
|
||||
@ -211,6 +212,24 @@ namespace logs
|
||||
{
|
||||
std::lock_guard lock(g_mutex);
|
||||
|
||||
if (ch_name.find_first_of(".+*?^$()[]{}|\\") != umax)
|
||||
{
|
||||
const std::regex ex(ch_name);
|
||||
|
||||
// RegEx pattern
|
||||
for (auto& channel_pair : get_logger()->channels)
|
||||
{
|
||||
std::smatch sm;
|
||||
|
||||
if (std::regex_match(channel_pair.first, sm, ex))
|
||||
{
|
||||
channel_pair.second->enabled.release(value);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
auto found = get_logger()->channels.equal_range(ch_name);
|
||||
|
||||
while (found.first != found.second)
|
||||
|
Loading…
Reference in New Issue
Block a user