当前位置: 首页>>代码示例>>Python>>正文


Python _global_log.threshold方法代码示例

本文整理汇总了Python中distutils.log._global_log.threshold方法的典型用法代码示例。如果您正苦于以下问题:Python _global_log.threshold方法的具体用法?Python _global_log.threshold怎么用?Python _global_log.threshold使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在distutils.log._global_log的用法示例。


在下文中一共展示了_global_log.threshold方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _log

# 需要导入模块: from distutils.log import _global_log [as 别名]
# 或者: from distutils.log._global_log import threshold [as 别名]
def _log(self, level, msg, args):
        if level >= self.threshold:
            if args:
                msg = msg % _fix_args(args)
            if 0:
                if msg.startswith('copying ') and msg.find(' -> ') != -1:
                    return
                if msg.startswith('byte-compiling '):
                    return
            print(_global_color_map[level](msg))
            sys.stdout.flush() 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:13,代码来源:log.py

示例2: good

# 需要导入模块: from distutils.log import _global_log [as 别名]
# 或者: from distutils.log._global_log import threshold [as 别名]
def good(self, msg, *args):
        """
        If we log WARN messages, log this message as a 'nice' anti-warn
        message.

        """
        if WARN >= self.threshold:
            if args:
                print(green_text(msg % _fix_args(args)))
            else:
                print(green_text(msg))
            sys.stdout.flush() 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:14,代码来源:log.py

示例3: set_threshold

# 需要导入模块: from distutils.log import _global_log [as 别名]
# 或者: from distutils.log._global_log import threshold [as 别名]
def set_threshold(level, force=False):
    prev_level = _global_log.threshold
    if prev_level > DEBUG or force:
        # If we're running at DEBUG, don't change the threshold, as there's
        # likely a good reason why we're running at this level.
        _global_log.threshold = level
        if level <= DEBUG:
            info('set_threshold: setting threshold to DEBUG level,'
                    ' it can be changed only with force argument')
    else:
        info('set_threshold: not changing threshold from DEBUG level'
                ' %s to %s' % (prev_level, level))
    return prev_level 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:15,代码来源:log.py

示例4: set_verbosity

# 需要导入模块: from distutils.log import _global_log [as 别名]
# 或者: from distutils.log._global_log import threshold [as 别名]
def set_verbosity(v, force=False):
    prev_level = _global_log.threshold
    if v < 0:
        set_threshold(ERROR, force)
    elif v == 0:
        set_threshold(WARN, force)
    elif v == 1:
        set_threshold(INFO, force)
    elif v >= 2:
        set_threshold(DEBUG, force)
    return {FATAL:-2,ERROR:-1,WARN:0,INFO:1,DEBUG:2}.get(prev_level, 1) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:13,代码来源:log.py


注:本文中的distutils.log._global_log.threshold方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。