From e76ce05e29274f7098b3799be49e190821915c1e Mon Sep 17 00:00:00 2001 From: Eladash Date: Sun, 9 Jul 2023 10:35:18 +0300 Subject: [PATCH] logs: Add manual set log level with RegEx --- rpcs3/util/logs.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/rpcs3/util/logs.cpp b/rpcs3/util/logs.cpp index b56c0be232..c900aa2745 100644 --- a/rpcs3/util/logs.cpp +++ b/rpcs3/util/logs.cpp @@ -11,6 +11,7 @@ #include #include #include +#include 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)