loglevel.py 文件源码

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

项目:argschema 作者: AllenInstitute 项目源码 文件源码
def _validate(self, value):
        """

        Parameters
        ----------
        value : str
            value to validate

        """
        if (not hasattr(logging, value) or
                type(getattr(logging, value)) is not int):
            raise mm.ValidationError(
                    '{} is not a valid loglevel; try one of {}'.format(
                        value, LogLevel.options))

        # Would prefer this to be an argparse.Action subclass, but not yet sure how to implement this way
        logging.getLogger().setLevel(value)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号