def save_dumps(self):
        thread_name = threading.currentThread().getName().lower()
        if thread_name == 'mainthread':
            thread_name = ''
        else:
            thread_name = '-%s' % thread_name
        file_name = os.path.join(self.config['log_dir'], '%02d%s.log' % (
            self.request_counter, thread_name))
        with open(file_name, 'wb') as out:
            out.write(b'Request headers:\n')
            out.write(self.request_head)
            out.write(b'\n')
            out.write(b'Request body:\n')
            out.write(self.request_body)
            out.write(b'\n\n')
            out.write(b'Response headers:\n')
            out.write(self.doc.head)

        file_extension = 'html'
        file_name = os.path.join(self.config['log_dir'], '%02d%s.%s' % (
            self.request_counter, thread_name, file_extension))
        self.doc.save(file_name)
dataset/ETHPy150Open lorien/grab/grab/base.py/Grab.save_dumps/original