<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_config_file(self, path):
 """ Set the config file. The contents must be valid YAML and there must be a top-level element 'tasks'. The listed tasks will be started according to their configuration, and the file will be watched for future changes. The changes will be activated by appropriate changes to the running tasks. """

        log = self._params.get('log', self._discard)
        if path != self._config_file:
            if self._config_file:
                log.info("Config file changed from '%s' to '%s'", self._config_file, path)
                self.file_del(self, paths=[self._config_file])
            else:
                log.info("Config file set to '%s'", path)
            self._config_file = path
            self.file_add(event_target(self, 'legion_config', log=log), path)
        return self._load_config()