Qt: simplify log level filtering in log viewer
This commit is contained in:
@@ -325,21 +325,16 @@ void log_viewer::filter_log()
|
|||||||
|
|
||||||
const auto add_line = [this, &result, &excluded_log_levels, ×tamp_regexp, &thread_regexp](QString& line)
|
const auto add_line = [this, &result, &excluded_log_levels, ×tamp_regexp, &thread_regexp](QString& line)
|
||||||
{
|
{
|
||||||
bool exclude_line = false;
|
if (!line.isEmpty())
|
||||||
|
{
|
||||||
for (const QString& log_level_prefix : excluded_log_levels)
|
for (QStringView log_level_prefix : excluded_log_levels)
|
||||||
{
|
{
|
||||||
if (line.startsWith(log_level_prefix))
|
if (line.startsWith(log_level_prefix))
|
||||||
{
|
|
||||||
exclude_line = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (exclude_line)
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (m_filter_term.isEmpty() || line.contains(m_filter_term))
|
if (m_filter_term.isEmpty() || line.contains(m_filter_term))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user