/// <summary> /// Checks whether the specified log entry matches with the filter. /// </summary> /// <param name="entry">Entry to check</param> /// <returns>True, if the entry matches with the filter; otherwise, false.</returns> public override bool MatchesEntry(DiagnosticsLogItem entry) { if (string.IsNullOrWhiteSpace(Pattern)) return true; var invert = Pattern[0] == '!'; var pattern = invert ? Pattern.Substring(1) : Pattern; var result = pattern == "*" || (entry.Source == pattern || entry.Source.StartsWith(pattern + ".")); return invert ? !result : result; }
/// <summary> /// Checks whether the specified log entry matches with the filter. /// </summary> /// <param name="entry">Entry to check</param> /// <returns>True, if the entry matches with the filter; otherwise, false.</returns> public abstract bool MatchesEntry(DiagnosticsLogItem entry);
/// <summary> /// Checks whether the specified entry mathces with all filters within the route. /// </summary> /// <param name="entry">Log data entry</param> /// <returns>True, if the entry matches with all filters; otherwise, false.</returns> public bool MatchesFilters(DiagnosticsLogItem entry) { return _filters.All(filter => filter.MatchesEntry(entry)); }
/// <summary> /// Checks whether the specified log entry matches with the filter. /// </summary> /// <param name="entry">Entry to check</param> /// <returns>True, if the entry matches with the filter; otherwise, false.</returns> public override bool MatchesEntry(DiagnosticsLogItem entry) { return ItemTypes.Any(item => item == DiagnosticsLogItemType.Undefined || item == entry.Type); }