Kittyfisto / Tailviewer

Open source log file viewer
https://kittyfisto.github.io/Tailviewer/
MIT License
184 stars 38 forks source link

Refactor/log file access #275

Closed Kittyfisto closed 3 years ago

Kittyfisto commented 3 years ago

Reason for this MR

Over time the past few years, more and more columns were added to Tailviewer (OriginalIndex and SourceId for a merged data source, DeltaTime and ElapsedTime for all) and the existing data model of having a simple struct for an entire line got harder and harder to support.

This is addressed by fully implementing the new API in which ILogFiles are similar to an excel sheet: They have a variable amount of columns and rows. Custom log files may even introduce rows not part of Tailviewer.Core (however there's no display component for this just yet) and still take part in log file merging, filtering, etc..

With this new API, clients may retrieve data from only those columns they are interested in, i.e. if one wants to display the RawContent column, then all one has to do is:

logFile.GetEntries(section, buffer, LogFileColumns.RawContent);

And the ILogFile will take care of copying the relevant portions into the destination buffer. There's countless of overloads for ILogFile.GetEntries to:

Changes proposed in this pull request:

Replaced usage of deprecated API with "new" one:

Any expected problems concerning backwards compatibility of existing plugins?

Yes - Some plugins will be broken:

Removed Types

Changed Types

Renamed Types

Any expected problems concerning backwards compatibility of existing user settings?

No

Does this break existing user workflows?

No