-
Notifications
You must be signed in to change notification settings - Fork 185
Description
Today the LogfileReader constructor has a boolean that indicates if it is a multi file or not.
Today there are 3 ways to define if a file is multi file:
- press shift while you drag and drop multiple files into logexpert gui
- set the setting to the behaviour you like (initially it will be for every new dialog)
- set it, in the current focused tab, via the file menu, but this will only apply to the current focused tab
The current mechanism is based on the RolloverFilenameHandler in order for all the log files to be loaded without the need to open them separately. Using the MultiFileOptions you can even add a regex for it. This feature is intended for log files like:
log1.log
log2.log
log3.log
or
log_20250101.log
log_20250102.log
The code being discussed is in this place:
if (option == MultiFileOption.SingleFiles)
{
AddFileTabs(names);
}
else
{
AddMultiFileTab(names);
}- I think it's best to see it as multifile, if one or more files come in the array, and thats it, as long as 1 file is in the array it's multifile, no need for the boolean
- Actually the tests are wrong
it's only multifile if there are at least 1 Filename in the array other wise it's not multifile
LoadFilesAsMulti loads the multifile, and calls the multifile constructor, and if the filenames array has only 1 entry, it returns back and starts as multifile anyway - it just changes how the files are loaded, either in one single tab or in multiple tabs. This is then saved in the persistance data, where logexperts trys to remember the last loaded files
- I think the test are wrong here and need to be adapted, the buffershifttests, tests actually if the rollover is detected and the files are correctly loaded, which can only happen if it's a multifile (and it's only a multifile if there are 2 or more files in the array that's given in the constructore AND configured via the settings, otherwise the rollover is not taken into account.
- the default Setting is "a single tab for every file, without rollover detection" otherwise it can be activated in the UI anyway. So the boolean is actually not necessary, as long as there are 2 or more files in the array. yeah clearly the other test do not need it, only the buffershifttests need it, because of the rollover test.
- if multifile is set true, logexpert trys to load the files based on the formatpattern of the multifileoptions
and it is only set to true if you actually activate it otherwise it is false anyway - What I don't know is how will you make the rollover to run? If there is only one file what will cause the rollover to run? which is exactlly like asking, is this a multi file? what makes it true when there is only one file that needs rollover to run?
- public int ShiftBuffers ()
reads the rollingfile if a file has changed
the ShiftBuffers, is called after the fireChangedEvent is called, if Multifile is true
and loads the files if new files are there or something has changed - so shiftbuffers can detect if rollover is needed? no
- it relies on the multifile flag? yes
- What will set the flag to true if there is only one file? nothing, it has to be set explicitly, via UI or via SHIFT+Drag and Drop,
- if you have 2 tabs open and shift drag and drop, it will open a new tab with the files
- When I change in the UI the flag from single to multi and it is a potential multi file that is open(e.g. rollover should work) then should rollover happen or should the file be left alone? What about the opposite situation? If I loaded a file with rollover and now I cancel multi? What should happen?
- I am trying to decide if to do this "reactive" or maybe "observable".
- if you change to multi rollover should work, if you change back from multi to single, rollover should only work if the file is active and has size changes, aka something is written into the file
- The flag is in the File menu. Why? Is that the right place?
- How does it know which to use? according to active window.
- The settings, is global but only acccessd in the current Window so it is not really global since its called in the LogTabWindow, which is just a dialog
its basically what should happen in the current LogTabWindow.
Then it should be removed from the constructor. so I need to make sure it finds it way into the class from the ui. and I am leaving the test without a change. the test will fail though, if it is not set because shiftbuffers relies on multifile true.
During this issue a few things should happen:
- Update the wiki pages about the multi file options
- Change the way we detect multi file behaviour
- The tests should continue working
- When opening a file from open menu it should have an option for multi file, just like pressing shift when dragging