コード例 #1
0
        protected override ParsingResult ParseSource(ILogSource source, LogReaderSettings settings, ParsingResult result = null)
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            TextStorage storage = new TextStorage();

            result = result ?? new ParsingResult();
            var log = (IEnumerable <string[]>)source;

            if (!(source is AzureLogSource))
            {
                throw new ApplicationException("Non Azure log source was tried to be parsed by Azure log reader");
            }

            foreach (var lines in log)
            {
                var logEntry = logParser.ParseLine(lines[0], new DateTime(long.Parse(lines[1])), storage);
                if (logEntry != null)
                {
                    logEntry = AnalyzeLog(logEntry, storage);
                    result.AddToGroupAll(logEntry);
                }
            }
            return(result);
        }
コード例 #2
0
 private ParsingResult FilterLogs(ParsingResult parsingResultWithoutFiltering, LogReaderSettings settings)
 {
     ParsingResult parsingResult = new ParsingResult();
     foreach (var entry in parsingResultWithoutFiltering.All)
     {
         bool matchesFilter = false;
         ApplyFilter(entry.LogDateTime, settings, entry.ToString(), ref matchesFilter, false);
         if (matchesFilter)
             parsingResult.AddToGroupAll(entry);
     }
     return parsingResult;
 }
コード例 #3
0
        private ParsingResult FilterLogs(ParsingResult parsingResultWithoutFiltering, LogReaderSettings settings)
        {
            ParsingResult parsingResult = new ParsingResult();

            foreach (var entry in parsingResultWithoutFiltering.All)
            {
                bool matchesFilter = false;
                ApplyFilter(entry.LogDateTime, settings, entry.ToString(), ref matchesFilter, false);
                if (matchesFilter)
                {
                    parsingResult.AddToGroupAll(entry);
                }
            }
            return(parsingResult);
        }
コード例 #4
0
 protected override ParsingResult ParseSource(ILogSource source, LogReaderSettings settings, ParsingResult result = null)
 {
     if (source == null)
         throw new ArgumentNullException(nameof(source));
     
     TextStorage storage = new TextStorage();
     result = result ?? new ParsingResult();
     var log = (IEnumerable<string[]>)source;
     if (!(source is AzureLogSource))
         throw new ApplicationException("Non Azure log source was tried to be parsed by Azure log reader");
     
     foreach (var lines in log)
     {
         var logEntry = logParser.ParseLine(lines[0], new DateTime(long.Parse(lines[1])), storage);
         if (logEntry != null)
         {
             logEntry = AnalyzeLog(logEntry, storage);
             result.AddToGroupAll(logEntry);
         }
     }
     return result;
 }