private static bool FilterLogCatLog(LogCatLog logCatLog, FilterConfiguration config) { bool shouldFilterByString = config.filterByString.Length > 1; if (!shouldFilterByString || FilterByString(logCatLog, config.filterByString)) { } else { return(false); } bool shouldFilterByRegex = config.filterByRegex.Length > 1; if (!shouldFilterByRegex || FilterByRegex(logCatLog, config.filterByRegex)) { } else { return(false); } if (!config.prefilterOnlyUnity || FilterByUnityString(logCatLog)) { } else { return(false); } if (!config.filterTime || FilterByTimeSpan(logCatLog, config.filterByTimeFrom, config.filterByTimeTo)) { } else { return(false); } bool filtered = false; if (filtered || (config.filterError && FilterByType(logCatLog, 'E'))) { filtered = true; } if (filtered || (config.filterWarning && FilterByType(logCatLog, 'W'))) { filtered = true; } if (filtered || (config.filterDebug && FilterByType(logCatLog, 'D'))) { filtered = true; } if (filtered || (config.filterInfo && FilterByType(logCatLog, 'I'))) { filtered = true; } if (filtered || (config.filterVerbose && FilterByType(logCatLog, 'V'))) { filtered = true; } return(filtered); }
public static List <LogCatLog> FilterLogList(FilterConfiguration config, List <LogCatLog> fullLogList) { List <LogCatLog> filterLogList = new List <LogCatLog> (); // Filter foreach (var logCatLog in fullLogList) { if (FilterLogCatLog(logCatLog, config)) { filterLogList.Add(logCatLog); } } return(filterLogList); }
public void CleanUp() { testConfig = null; testLog = null; testLogList.Clear(); }
public void Init() { testConfig = new FilterConfiguration(); testLog = new LogCatLog("E/TestLogCat: level:86, scale:100, status:3, health:2, present:true "); testLogList = new List <LogCatLog> (); }