Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Loadable filter-files #234

Open
gin-ahirsch opened this issue Jul 19, 2018 · 8 comments
Open

Feature Request: Loadable filter-files #234

gin-ahirsch opened this issue Jul 19, 2018 · 8 comments

Comments

@gin-ahirsch
Copy link
Contributor

gin-ahirsch commented Jul 19, 2018

I'd like to be able to export some of my filters to a file, copy that file on another computer and import the filters there.

I've been working on this feature myself. It's not quite ready for a PR as I need to test my changes some more, some functionality is missing and I'd like to split the commit into two or three separate ones.

Here's how the new FiltersDialog looks.
First we have the "Loadable"-tab:
FiltersDialog
It displays the loaded files on the top. The filter sets are identified via their paths. I've thought about letting the user give a name to them which is displayed instead.
The available filters in a file are displayed in the lower left and the activated filters in the lower right.
When a loaded filter is subsequently modified, the changes can be undone or stored to the filter file (this is not yet implemented).

Then we have the "Active"-tab, which is mostly the original FiltersDialog:
FiltersDialog
The loaded filters are marked via an icon to the right. I'm not sure what the icon should be here, the circle is just something arbitrary to have something.
Two things that are currently missing is a different icon when the filter has been modified here and I'd also like to show the filter-file a selected filter came from in a label below the controls in the right half.
There's also the new "Save to file"-button. The ListWidget was changed to allow multiple items to be selected. A push of the button brings to a file-save-dialog to store the filters in a file on the disk, which can then be loaded in the "Loadable"-tab.

Apart from the unimplemented features already mentioned, the loaded files are currently also not saved on disk, i.e. they do not persist between two sessions.
The current implementation can be tested from my filter-files branch. Feedback is welcome.

@gin-ahirsch
Copy link
Contributor Author

While implementing the modification-detection I stumbled upon a couple of questions:

Should the view in "Loadable" be updated to include the modifications to the filter? Currently (not yet pushed) I just show the modification-symbol, but do not change the filter itself. There could also be a button to apply the new modifications to the file (and update the view accordingly), so that this is not immediate and automatic. The "Save changes"-button would be removed from the "Loadable"-tab.
When saving filters to a file, should it automatically be added in the "Loadable"-tab, and should the filters be associated with it (so that further modification will show the modification-symbol)?
Should saving a modified filter to a file remove the association with the original file it was loaded from?

I don't feel like there's a right answer here. Likely some decision just needs to be made.
Another possibility would be disallowing modifications to a loaded filter and instead provide a "Copy"-button for the loaded filters instead, which will remove the association with the filter file. Though I think this is less nice if you indeed want to change (persistently) a filter from a file.

My favorite is the a button to manually update a modified filter, automatically add "Save to file" to the filter-files list and re-associating the saved filters with the new filter file.

@gin-ahirsch
Copy link
Contributor Author

The branch is shaping up nicely.

Currently, modified version of loaded filters are only visible in the "Loadable" tab via a modification-icon. The item in the list is not changed to reflect the changes done.

The "Save changes" and "Undo changes" buttons work now.

The loaded filter files and local changes now also saved on disk and thus persist between sessions. Local changes are stored in the "glogg.conf" and do not change the loaded filter file (unless "Save changes" is used).

The loaded filter files are referred to from the "glogg.conf" via their absolute paths. It currently crashes via assert() if the file cannot be found, eventually I'd like to just put a red background on the item so that the "glogg.conf" can easily be moved between systems for example. Active filters from the filter files are also saved in "glogg.conf", so they can be active without the filter file being available.

Additionally, files matching "$AppLocalDataLocation/filters/*.conf" are automatically loaded.

@garyee
Copy link

garyee commented Jan 22, 2019

It would be really nice to have this. To have a file-based filtersystem would permit to have a different set of filters for different kind of logs!
If I can add one, it would be great to have "filter-profiles" with a button toolbar where one could switch the profiles easily.

@gin-ahirsch
Copy link
Contributor Author

@garyee Check out https://github.com/gin-ahirsch/glogg/tree/filter-files-for-upstream, I'm really just waiting on #230 or #236 to be merged before opening a PR. Note that these, and some other, changes are included in that branch (which is why a PR for it is not yet opened).

@gin-ahirsch
Copy link
Contributor Author

I pushed two bug-fixes and changed the loaded- and modified-icons to resemble an "L" and an "M" respectively.

@rickhau
Copy link

rickhau commented Jul 6, 2019

Filter files are very crucial feature for log explorer. Hope this feature can be merged as soon as possible.

@amitkot
Copy link

amitkot commented Aug 11, 2019

This is a very important feature for our uses as well. This project is super useful - hands down the best open source log explorer currently available afaik.

@variar
Copy link
Contributor

variar commented May 9, 2021

This has been implemented in klogg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants