Flush stream when logging to standard output

Print everything in the stdout buffer immediately.