Kittyfisto / Tailviewer

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

Start Text Log File Streaming #276

Closed Kittyfisto closed 3 years ago

Kittyfisto commented 3 years ago

Defects

Fixes #277 Fixes #278 Fixes #279 Fixes #280 Fixes #281 Fixes #282

Reason for this change

At the moment, Tailviewer streams the entire contents of a log file into memory. This is fine as long as you're viewing small text log files or have enough main memory to waste. Due to storing the text log contents as strings, things are even more serious as every character takes up 2 bytes: A typical ASCII or UTF-8 log file will require at least twice it's size in memory when viewed (excluding indices).

In order to allow viewing huge log files (several Gb in size), Tailviewer needs to only stream those contents of the file into memory which are actually being viewed.

This MR lays the foundation for streaming text log files: Full streaming will probably be implemented over several MRs.

Detailed description

The ILogFile.GetColumn, ILogFile.GetEntries and ILogEntries.CopyFrom overloads which took a LogFileSection parameter have been removed due to the amount of complexity introduced in the various implementations. There are only a few cases where having a contiguous source region is advantageous and in those cases, the implementation can perform a simple check if the source is of type LogFileSection.

Any expected problems concerning backwards compatibility of existing plugins?

Yes

Added Types

Modified Types

Any expected problems concerning backwards compatibility of existing user settings?

No

Does this break existing user workflows?

No