本文整理匯總了Python中twisted.logger.Logger.startLoggingWithObserver方法的典型用法代碼示例。如果您正苦於以下問題:Python Logger.startLoggingWithObserver方法的具體用法?Python Logger.startLoggingWithObserver怎麽用?Python Logger.startLoggingWithObserver使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類twisted.logger.Logger
的用法示例。
在下文中一共展示了Logger.startLoggingWithObserver方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: print
# 需要導入模塊: from twisted.logger import Logger [as 別名]
# 或者: from twisted.logger.Logger import startLoggingWithObserver [as 別名]
return defer.succeed(_cb_deferred(ret.result, ctx))
ret.addCallback(_cb_deferred, ctx)
ret.addErrback(_eb_deferred, ctx)
return ret
else:
self.get_out_string(ctx)
# print('no deferred: %s' % ctx.out_string)
log.debug('result type no deferred')
return defer.succeed(ctx.out_string)
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
logging.getLogger('spyne_plus.protocol.xml').setLevel(logging.DEBUG)
observer = log.PythonLoggingObserver('twisted')
log.startLoggingWithObserver(observer.emit, setStdout=False)
from upnpy_spyne.devices.ohSource import Source
from onDemand.plugins.mpd import get_Mpd
from twisted.internet.task import react
from upnpy_spyne.xmpp import XmppService
def main(reactor):
s = XmppService(reactor, device)
s.startService()
return s.finished
n, f = get_Mpd(addr='192.168.0.9')
device = Source(
'test xmpp renderer',
f,
'/home/babe/Projets/eclipse/onDemand/data/')