'Initialization function that should peform ONLY the required
setup so that the self.record() method works.
As of now self.record() needs self.resultdir, self._group_level,
self.harness and of course self._logger.'

def _pre_record_init(self, control, options):

    if (not options.cont):
        self._cleanup_debugdir_files()
        self._cleanup_results_dir()
    logging_manager.configure_logging(client_logging_config.ClientLoggingConfig(), results_dir=self.resultdir, verbose=options.verbose)
    logging.info('Writing    results    to    %s', self.resultdir)
    self.control = os.path.realpath(control)
    self._is_continuation = options.cont
    self._current_step_ancestry = []
    self._next_step_index = 0
    self._load_state()
    _harness = self.handle_persistent_option(options, 'harness')
    _harness_args = self.handle_persistent_option(options, 'harness_args')
    self.harness = harness.select(_harness, self, _harness_args)
    def client_job_record_hook(entry):
        msg_tag = ''
        if ('.' in self._logger.global_filename):
            msg_tag = self._logger.global_filename.split('.', 1)[1]
        message = '\n'.join(([entry.message] + entry.extra_message_lines))
        rendered_entry = self._logger.render_entry(entry)
        self.harness.test_status_detail(entry.status_code, entry.subdir, entry.operation, message, msg_tag, entry.fields)
        self.harness.test_status(rendered_entry, msg_tag)
        logging.info(rendered_entry)
    self._logger = base_job.status_logger(self, status_indenter(self), record_hook=client_job_record_hook, tap_writer=self._tap)
