-
Notifications
You must be signed in to change notification settings - Fork 504
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/line seeker #108
base: master
Are you sure you want to change the base?
Feature/line seeker #108
Conversation
7dd12fc
to
7a62e5c
Compare
d8a03b5
to
2a149d7
Compare
@Nino-K This is passing now for 1.7+. This is because my package is using io.SeekStart, which replaced os.SEEK_SET in 1.7. I can update my package to handle this if its important to you. But maybe tail could drop those while adding 1.9? I have another PR that removed os.SEEK from tail and drops 1.5 and 1.6 from travis. |
Added line seeker to gotail cmd. Switched -n from using position in file to lines. |
164f04a
to
614cf3e
Compare
614cf3e
to
4c42fd0
Compare
@StoicPerlman any updates here? |
@nishantroy This is working just fine for me. No word from the project maintainers. If you check out the Travis build you can see this PR its passing for Go 1.7+. I have another PR on this repo to remove some deprecated go features and drop support for under 1.7. I added this functionality by creating a library which is also passing all tests on master branch for 1.7+ If you are interested in looking it over you can find it here https://travis-ci.org/StoicPerlman/fls. If you want this functionality now just used my forked version until this gets merged. https://github.com/StoicPerlman/tail. |
Pipe bool // Is a named pipe (mkfifo) | ||
RateLimiter *ratelimiter.LeakyBucket | ||
Location *SeekInfo // Seek to this location before tailing | ||
LineLocation *SeekInfo // Seek to this line number before tailing |
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.
@nishantroy To make this work just set this LineLocation in the config. It works the the same way Location works, but instead of moving by position it moves by \n's.
Also see the README on the underlying library https://github.com/StoicPerlman/fls. If you have trouble using it just shoot me a message.
This is a a rough draft for issue #83 seek by line. Any feedback will be in PR update.
See https://github.com/StoicPerlman/fls to get info on how line seeking works
Tests pass locally in docker build but not in travis. Still working on this. Any advice would be helpful as I am pretty new to travis and go.