Writes a line of text to a log file.