我们从Python开源项目中,提取了以下20个代码示例,用于说明如何使用distutils.log.FATAL。
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 = []
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))
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 = []
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))
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 = []
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))