public void Read() { invoker.Invoke(() => { try { foreach (var item in File.Read(stream => parser.Parse(stream))) { LogEntry(item); } } catch (OutOfBoundsException) { if (!TryInvokeOutOfBounds()) { throw; } } catch (Exception e) { if (!TryInvokeExceptionOccurred(e)) { throw; } } }); }
public IReadOnlyLogEntry Parse(IReadOnlyLogEntry logEntry) { try { return(_inner.Parse(logEntry)); } catch (Exception e) { Log.ErrorFormat("Caught unexpected exception: {0}", e); return(logEntry); } }
/// <inheritdoc /> public void GetEntries(IReadOnlyList <LogLineIndex> sourceIndices, ILogBuffer destination, int destinationIndex, LogSourceQueryOptions queryOptions) { var source = _source; if (source != null) { var columnsToCopy = new IColumnDescriptor[] { Core.Columns.Index, Core.Columns.RawContent }; var tmp = new LogBufferArray(sourceIndices.Count, columnsToCopy); source.GetEntries(sourceIndices, tmp, 0, queryOptions); foreach (var column in columnsToCopy) { if (destination.Contains(column)) { destination.CopyFrom(column, destinationIndex, tmp, new Int32Range(0, sourceIndices.Count)); } } for (var i = 0; i < sourceIndices.Count; ++i) { var parsedLogEntry = _parser.Parse(tmp[i]); if (parsedLogEntry != null) { destination[destinationIndex + i].CopyFrom(parsedLogEntry); } else { destination[destinationIndex + i].CopyFrom(_nothingParsed); } } } else { destination.FillDefault(destinationIndex, sourceIndices.Count); } }