nickstenning / honcho

Honcho: a python clone of Foreman. For managing Procfile-based applications.
http://pypi.python.org/pypi/honcho
MIT License
1.59k stars 145 forks source link

Cannot tail -f | jq #197

Closed ptbrowne closed 4 years ago

ptbrowne commented 6 years ago

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 ?

nickstenning commented 4 years ago

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 '.'
ptbrowne commented 4 years ago

Thanks !