本文整理匯總了Python中twisted.logger.Logger.__get__方法的典型用法代碼示例。如果您正苦於以下問題:Python Logger.__get__方法的具體用法?Python Logger.__get__怎麽用?Python Logger.__get__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類twisted.logger.Logger
的用法示例。
在下文中一共展示了Logger.__get__方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Logger
# 需要導入模塊: from twisted.logger import Logger [as 別名]
# 或者: from twisted.logger.Logger import __get__ [as 別名]
Start here if you are looking to write a new protocol implementation for
Twisted. The Protocol class contains some introductory material.
"""
from __future__ import division, absolute_import
import random
from zope.interface import implementer
from twisted.python import log, failure, components
from twisted.internet import interfaces, error, defer
from twisted.logger import Logger
_log = Logger()
_logFor = lambda _:_log.__get__(_, _.__class__)
@implementer(interfaces.IProtocolFactory, interfaces.ILoggingContext)
class Factory:
"""
This is a factory which produces protocols.
By default, buildProtocol will create a protocol of the class given in
self.protocol.
"""
# put a subclass of Protocol here:
protocol = None