nickstenning / honcho

Honcho: a python clone of Foreman. For managing Procfile-based applications.

Home Page:http://pypi.python.org/pypi/honcho

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot tail -f | jq

ptbrowne opened this issue · comments

When I do

logs: tail -f logs

everything is OK, but when I do

logs: tail -f logs | jq '.'

I have no output :/ Same if I do

logs: bash -c "tail -f logs | jq '.'"

I tried to do launch honcho with `env PYTHONUNBUFFERED=1 honcho start' but to no avail.

Is there any solution ?

Yup, there's a solution!

First of all, you should be able to verify that this isn't a honcho issue by running

tail -f logs | jq '.' | less

You'll see the same problem -- no output.

But you can override the buffering mode of STDOUT for jq using stdbuf(1):

tail -f logs | stdbuf -oL jq '.' | less

Or, for honcho:

logs: tail -f logs | stdbuf -oL jq '.'

Thanks !