osproject.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:setupproject-openstack 作者: jriguera 项目源码 文件源码
def setup_logging(self):
        self.logpath = os.environ.get(self.LOGENVCONF, self.LOGGING)
        try:
            #logging.config.fileConfig(self.logpath)
            with open(self.logpath) as logconfig:
                logdata = yaml.load(logconfig)
                logging.config.dictConfig(logdata)
        except Exception as e:
            print("Error with '%s': %s" % (self.logpath, e))
            logging.basicConfig(level=self.LOGLEVEL, format=self.OUTPUT_FORMAT)
            lfile = False
        else:
            lfile = True
        self.logger = logging.getLogger(self.PROG)
        if not lfile:
            self.logger.info("Using default logging settings")
        else:
            self.logger.info("Using logging settings from '%s'" % self.logpath)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号