revert removal of extraneous newlines
clean up extra new lines and LogDisplay line break
flush stdout in case non new-line output is received