Added log-output-to-buffer functionality