def _startRecording(self, filename):
        """
        Start recording the session to a file for debug purposes.
        """
        self.setOption('_log_file_name', filename)
        self.setOption('_log_input_only', True)
        self.setOption('_log', True)
Start recording the session to a file for debug purposes.