log.py 文件源码

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

项目:rdiff-backup 作者: sol1 项目源码 文件源码
def __call__(self, message, verbosity):
        """Log message that has verbosity importance

        message can be a string, which is logged as-is, or a function,
        which is then called and should return the string to be
        logged.  We do it this way in case producing the string would
        take a significant amount of CPU.

        """
        if verbosity > self.verbosity and verbosity > self.term_verbosity:
            return

        if not (type(message) is types.StringType
                or type(message) is types.UnicodeType):
            assert type(message) is types.FunctionType
            message = message()

        if verbosity <= self.verbosity: self.log_to_file(message)
        if verbosity <= self.term_verbosity:
            self.log_to_term(message, verbosity)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号