-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: Fast stdin display, lower memory usage, follow/reverse mode, home/end key support. long help support #85
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
praise: thank you, I'll review it this week.
I'm still on it, need more time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- suggestion: there are many complex changes, can we extend tests? I can help with it, and yes, it's possible to do in another PR.
- note: I'll try to use it for a week for manual testing.
todo: the PR title should be:
"feat: Fast stdin display, lower memory usage, follow/reverse mode, home/end key support. long help support"
it will fix:
- todo: please also include "
Closes #52, #64, #79
" in the PR description. - praise: nice, thank you for your pull request.
…on string Signed-off-by: Hiram Chirino <hiram@hiramchirino.com>
…of stdin fed logs. Log lines are not kept in memory anymore, we now just hold keep an offset, length for each line. Reload feature dropped since we now display stdin updates as soon as they are available.
Signed-off-by: Hiram Chirino <hiram@hiramchirino.com>
Signed-off-by: Hiram Chirino <hiram@hiramchirino.com>
Signed-off-by: Hiram Chirino <hiram@hiramchirino.com>
Co-authored-by: Maksym Kryvchun <hedhyw@yahoo.com>
Co-authored-by: Maksym Kryvchun <hedhyw@yahoo.com>
Signed-off-by: Hiram Chirino <hiram@hiramchirino.com>
Rebased and applied your suggestions. I'll be able to look into this more next week. |
Signed-off-by: Hiram Chirino <hiram@hiramchirino.com>
Fixed the linter warnings. Let me know if there are any other bits you want adjusted. |
the test coverage decreased significantly, I can help with tests here |
The latest changes don't work for me.
commit 88a3750 |
Co-authored-by: Maksym Kryvchun <hedhyw@yahoo.com> Signed-off-by: Hiram Chirino <hiram@hiramchirino.com>
Broke in ec18c3c Signed-off-by: Hiram Chirino <hiram@hiramchirino.com>
That break is fixed now. |
Maybe I got a little carried away. It would have been better if this was done over several commits. Feel free to cherry-pick ideas from this PR if you like any of its features.
The main reason I started down this path was that I expected
docker logs XXX -f | jlv
to behave similarly totail -f
with lo events just showing up as they occurred. With this PR, stdin input is displayed instantly. The log table now has a follow mode which is turned off once you navigate away from the latest log entry so the log entries will stop scrolling past the window.While at it I noticed that we could optimize memory use by NOT holding log line data in memory. We just need an offset, and length pair for each long line. When the log is displayed we just load it back from the file. Maybe we should increase the default MAX file size setting? Might need some testing to figure out a better default.
If you have a fast log stream, it might be hard to get back into follow mode by pressing the up key enough times to go past the first item, so Home/End key support was added.
And while at it, I reversed log file order and option. pressing r will toggle.
With so many new options, and mode, I added support for long help display. Press ? to show the more advanced key binds.