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

Ability to toggle time based filtering and string match based filtering separately #1387

Open
ConorMurphy21 opened this issue Feb 13, 2025 · 2 comments
Labels
enhancement Feature Request

Comments

@ConorMurphy21
Copy link

I am able to script this myself so I don't think this is the highest priority, though I think my script would be significantly slower and work similar to the way ctrl + f works instead of :toggle-filtering. But I thought I'd mention the use case, and see what you think.

I personally prefer :toggle-filtering over ctrl + f. This is because I like to look at the logs, add a new filter for a line I see that looks interesting, toggle it off and keep looking for other interesting lines until I have a list of filters that I think should give me an idea of what's going on. While I'm doing this though, if I decide I want to disable a filter temporarily it will ruin my workflow because now when I toggle off filters I actually just toggle on the filters that are in limbo. :toggle-filtering works perfectly in this regard. The problem I have with :toggle-filtering is that it also toggles time-filtering (hide-lines-before, hide-lines-after). In my workflow that makes the time-filtering much less useful because I have to be much more aware of the timestamps when looking for filters to add.

As for a proposed solution. I'm not exactly sure because having more granular filtering probably leads to hierarchical filtering which opens up a can of worms. Assuming that for backwards compatibility reasons, changing what :toggle-filtering does isn't on the table. I guess my proposal would be to have 3 bits (though maybe others would prefer more granular like in, out filters idk). But 1 bit for filtering-enabled, 1 for time-filtering-enabled, and 1 for text-filtering-enabled. :toggle-filtering, :toggle-time-filtering, :toggle-text-filtering would toggle each respectively. Or alternatively an option to the existing command e.g. :toggle-filtering --time / -t. And then only enable text filtering if both bits are 1, and same with time filtering.

@ConorMurphy21 ConorMurphy21 added the enhancement Feature Request label Feb 13, 2025
@tstack
Copy link
Owner

tstack commented Feb 13, 2025

I personally prefer :toggle-filtering over ctrl + f.

Hmm, this seems like a bug. CTRL + F should probably be bound to :toggle-filtering. The current keymap has it running an UPDATE that changes the enabled/disabled state of the individual filters.

Your main point sounds reasonable.

@ConorMurphy21
Copy link
Author

I just noticed, this is also the case with set-min-log-level, not sure if it makes sense for log level filtering to be able to be toggled separate from text-filtering.

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

No branches or pull requests

2 participants