add printOnFlush option
Merge pull request #5 from simontabor/print-on-flush

Add printOnFlush option