public BasicLogTree() { _logReader = new BasicLogReader(); _logAnalyzer = new LogAnalyzer(); _patternsManager = new GrokPatternsManager(); _logLines = new List <string>(); _patternsManager.LoadPatterns(); }
private bool analyze(ILogAnalyzer a, string line, int lineNumber, string sourceName) { try { return(a.Analyze(line, lineNumber, sourceName)); } catch { // Just suppress exception and do nothing; too costly to do anything here. return(false); } }
private void endReadAll(ILogAnalyzer a) { try { a.EndReadAll(); } catch (Exception exc) { Reports.Add(new StatusReport { Source = a.GetType(), Message = $"ILogAnalyzer {a.GetType()} threw an exception during EndReadAll(). {exc.Message}", ReportType = ReportType.Warning }); } }
private void beginRead(ILogAnalyzer a, string sourceName) { try { a.BeginRead(sourceName); } catch (Exception exc) { Reports.Add(new StatusReport { Source = a.GetType(), Message = $"ILogAnalyzer {a.GetType()} threw an exception during BeginRead({sourceName}). {exc.Message}", ReportType = ReportType.Warning }); } }