Feature: Logging Search Bar
Description
Inspired by a short exchange on the forum: https://forum.syncthing.net/t/feature-elasticsearch-integration/21186/4?u=dalba-sudo. I'm thinking of adding a search bar in the log section of the GUI.
Use Case
"I think much simpler than this the log interface in the GUI can use a simple text search. Show me all log lines that match GX6GIWE (a device) or a file name, or an error…" - mraneri
Here's my current idea for the filtering implementation:
- add a filter function to the logging scope/class (kind of new angular, not sure what you'd call it).
- called by ng-keyup callback on an input of type text (i.e., the "search bar").
- only filters on keywords more than 2 characters long (if you want to look for something that is 2 characters long, use a wildcard as the third character?)
- add an input of type text in the
logViewerModalView
I've linked to a video demoing the current implementation - it's bare-bones and not currently designed for scale. Before I go back to the drawing board to think about ways to make this scalable for larger logs, I want to get feedback on the feature!
Demo: https://youtu.be/64B5Fa2fiq4
This is my first contribution to open-source, any feedback is appreciated (i.e., more detail explaining the feature, etc).
Cheers, DAlba-Sudo
I've implemented these changes in my own fork of the repo, going to wait to hear back before making a PR in case there's something that should be implemented before-hand.
Looks nice and I wouldn't mind adding this with a clean and performant implementation. I must admit though that I seldomly look at the logs and if so, usually not through the GUI, but by starting Syncthing on the console with appropriate piping. For troubleshooting a running instance though, this seems definitely good to have.
Honestly, the log in the GUI is truncated so much that I'd say it's barely useful in itself. When I've had issues, every time I was forced to save full logs on the disk and look for the culprit there, as the point in time that mattered was always long gone in the GUI.
Interesting, I see what you mean. I've gone ahead and made a PR in case we decide to include it: #9255.