本文整理匯總了Python中twisted.logger.LogLevel.warn方法的典型用法代碼示例。如果您正苦於以下問題:Python LogLevel.warn方法的具體用法?Python LogLevel.warn怎麽用?Python LogLevel.warn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類twisted.logger.LogLevel
的用法示例。
在下文中一共展示了LogLevel.warn方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: mqtt_exception
# 需要導入模塊: from twisted.logger import LogLevel [as 別名]
# 或者: from twisted.logger.LogLevel import warn [as 別名]
def mqtt_exception(self, failure, topic, payload):
log.failure(u'Problem publishing error message:\n{log_failure}', failure=failure, level=LogLevel.warn)
示例2: test_unknown_correlation_id
# 需要導入模塊: from twisted.logger import LogLevel [as 別名]
# 或者: from twisted.logger.LogLevel import warn [as 別名]
def test_unknown_correlation_id(self):
"""
A warning is logged and the connection dropped when a response with an
unknown correlation ID is received.
"""
events = EventLoggingObserver.createWithCleanup(self, globalLogPublisher)
self.transport.bufferReceived(b'\0\0\0\x101234 more stuff..')
self.assertTrue(self.transport.disconnecting)
[event] = events
self.assertEqual(LogLevel.warn, event['log_level'])
self.assertEqual(self.peer, event['peer'])
self.assertEqual(b'1234', event['correlation_id'])
示例3: test_logLevelValid
# 需要導入模塊: from twisted.logger import LogLevel [as 別名]
# 或者: from twisted.logger.LogLevel import warn [as 別名]
def test_logLevelValid(self):
"""
L{TwistOptions.opt_log_level} sets the corresponding log level.
"""
options = TwistOptions()
options.opt_log_level("warn")
self.assertIdentical(options["logLevel"], LogLevel.warn)