本文整理汇总了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)