コード例 #1
0
 public BasicLogTree()
 {
     _logReader       = new BasicLogReader();
     _logAnalyzer     = new LogAnalyzer();
     _patternsManager = new GrokPatternsManager();
     _logLines        = new List <string>();
     _patternsManager.LoadPatterns();
 }
コード例 #2
0
ファイル: LogReader.cs プロジェクト: Jabestrada/LogsAnalyzer
 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);
     }
 }
コード例 #3
0
ファイル: LogReader.cs プロジェクト: Jabestrada/LogsAnalyzer
 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
         });
     }
 }
コード例 #4
0
ファイル: LogReader.cs プロジェクト: Jabestrada/LogsAnalyzer
 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
         });
     }
 }