removing extraneous newline, default testing for @logfile