本文整理匯總了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))