Ejemplo n.º 1
0
    def __init__(self, env, conf_file):
        self.env = env

        self._log_init(conf_file.split('.')[0])

        self.conf = SearchEngineConf('/'.join([self.env.conf_dir(),
                                               conf_file]))

        LOG.set_log_level(self.conf.log_level())

        self.analyze_conf = AnalyzeConf('/'.join(
            [self.env.basic_conf_dir(), env_cons.ANALYZE_CONF_FILE]))
        self.db = SearchEngineDB(self.analyze_conf)

        module_name = "analyze.search_engine.%s" % (self.conf.engine_name())
        m = importlib.import_module(module_name)
        self.engine = m.SearchEngine(self.conf, self.env, self.db)
Ejemplo n.º 2
0
    def _log_init(self, id):
        LOG.set_log_id(id)
        LOG.set_log_level('info')

        log_file = self.env.log_dir() + "/" + id + ".log"
        LOG.set_log_file(log_file)