本文整理汇总了Python中distutils.log.FATAL属性的典型用法代码示例。如果您正苦于以下问题:Python log.FATAL属性的具体用法?Python log.FATAL怎么用?Python log.FATAL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类distutils.log
的用法示例。
在下文中一共展示了log.FATAL属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_test
# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import FATAL [as 别名]
def run_test(self, filename):
path = os.path.join(self.path, filename)
self.announce("Running %s..." % filename, log.INFO)
try:
execfile(path)
except Exception, e:
self.announce('Test case failed: %s (%r)' % (filename, e), log.FATAL)
raise e
示例2: setUp
# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import FATAL [as 别名]
def setUp(self):
super(LoggingSilencer, self).setUp()
self.threshold = log.set_threshold(log.FATAL)
# catching warnings
# when log will be replaced by logging
# we won't need such monkey-patch anymore
self._old_log = log.Log._log
log.Log._log = self._log
self.logs = []
示例3: _log
# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import FATAL [as 别名]
def _log(self, level, msg, args):
if level not in (DEBUG, INFO, WARN, ERROR, FATAL):
raise ValueError('%s wrong log level' % str(level))
self.logs.append((level, msg, args))
示例4: setUp
# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import FATAL [as 别名]
def setUp(self):
super().setUp()
self.threshold = log.set_threshold(log.FATAL)
# catching warnings
# when log will be replaced by logging
# we won't need such monkey-patch anymore
self._old_log = log.Log._log
log.Log._log = self._log
self.logs = []
示例5: _log
# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import FATAL [as 别名]
def _log(self, level, msg, args):
if level not in (DEBUG, INFO, WARN, ERROR, FATAL):
raise ValueError('%s wrong log level' % str(level))
if not isinstance(msg, str):
raise TypeError("msg should be str, not '%.200s'"
% (type(msg).__name__))
self.logs.append((level, msg, args))
示例6: setup_method
# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import FATAL [as 别名]
def setup_method(self, method):
super(TestFileListTest, self).setup_method(method)
self.threshold = log.set_threshold(log.FATAL)
self._old_log = log.Log._log
log.Log._log = self._log
self.logs = []
示例7: _log
# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import FATAL [as 别名]
def _log(self, level, msg, args):
if level not in (log.DEBUG, log.INFO, log.WARN, log.ERROR, log.FATAL):
raise ValueError('%s wrong log level' % str(level))
self.logs.append((level, msg, args))