Make sure that logged statement always ends with newline

Otherwise, several statements could be printed on the same line, which looks ugly and is just bad.