#308 incorporated changes suggested by Ernesto and Dmitry to make the '\n' appending logic in the file logger more clear and performant