Normally application output is printed to STDOUT whenever a newline is encountered (“line buffering”). However, line buffering is disabled when piping to another application. This is particularly annoying, for example, when piping the output of an application to tee in order to both observe and save it to a log.

The unbuffer command restores line buffering in pipes. Use like so:

unbuffer $APPLICATION | tee $LOG