當前位置: 首頁>>代碼示例>>Python>>正文


Python _global_log.good方法代碼示例

本文整理匯總了Python中distutils.log._global_log.good方法的典型用法代碼示例。如果您正苦於以下問題:Python _global_log.good方法的具體用法?Python _global_log.good怎麽用?Python _global_log.good使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在distutils.log._global_log的用法示例。


在下文中一共展示了_global_log.good方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: good

# 需要導入模塊: from distutils.log import _global_log [as 別名]
# 或者: from distutils.log._global_log import good [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

示例2: set_threshold

# 需要導入模塊: from distutils.log import _global_log [as 別名]
# 或者: from distutils.log._global_log import good [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


注:本文中的distutils.log._global_log.good方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。