mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 23:11:25 +12:00
logs: Add manual set log level with RegEx
This commit is contained in:
parent
a98174be85
commit
e76ce05e29
1 changed files with 19 additions and 0 deletions
|
@ -11,6 +11,7 @@
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
|
#include <regex>
|
||||||
|
|
||||||
using namespace std::literals::chrono_literals;
|
using namespace std::literals::chrono_literals;
|
||||||
|
|
||||||
|
@ -211,6 +212,24 @@ namespace logs
|
||||||
{
|
{
|
||||||
std::lock_guard lock(g_mutex);
|
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);
|
auto found = get_logger()->channels.equal_range(ch_name);
|
||||||
|
|
||||||
while (found.first != found.second)
|
while (found.first != found.second)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue