| 1783 | } |
| 1784 | |
| 1785 | TextColor CLogView::GetTextColor(const Message& msg) const |
| 1786 | { |
| 1787 | auto messageFilters = MoveHighlighFiltersToFront(m_filter.messageFilters); |
| 1788 | for (auto& filter : messageFilters) |
| 1789 | { |
| 1790 | std::smatch match; |
| 1791 | if (filter.enable && FilterSupportsColor(filter.filterType) && std::regex_search(msg.text, match, filter.re)) |
| 1792 | { |
| 1793 | if (filter.bgColor == Colors::Auto) |
| 1794 | { |
| 1795 | auto it = m_matchColors.find(MatchKey(match, filter.matchType)); |
| 1796 | if (it != m_matchColors.end()) |
| 1797 | return TextColor(it->second, Colors::Text); |
| 1798 | } |
| 1799 | else |
| 1800 | { |
| 1801 | return TextColor(filter.bgColor, filter.fgColor); |
| 1802 | } |
| 1803 | } |
| 1804 | } |
| 1805 | |
| 1806 | auto processFilters = MoveHighlighFiltersToFront(m_filter.processFilters); |
| 1807 | for (auto& filter : processFilters) |
| 1808 | { |
| 1809 | if (filter.enable && FilterSupportsColor(filter.filterType) && std::regex_search(msg.processName, filter.re)) |
| 1810 | return TextColor(filter.bgColor, filter.fgColor); |
| 1811 | } |
| 1812 | |
| 1813 | return TextColor(m_processColors ? msg.color : Colors::BackGround, Colors::Text); |
| 1814 | } |
| 1815 | |
| 1816 | bool CLogView::IsClearMessage(const Message& msg) const |
| 1817 | { |
nothing calls this directly
no test coverage detected