本文整理汇总了Python中twisted.logger.Logger.startLogging方法的典型用法代码示例。如果您正苦于以下问题:Python Logger.startLogging方法的具体用法?Python Logger.startLogging怎么用?Python Logger.startLogging使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted.logger.Logger
的用法示例。
在下文中一共展示了Logger.startLogging方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: search
# 需要导入模块: from twisted.logger import Logger [as 别名]
# 或者: from twisted.logger.Logger import startLogging [as 别名]
def search(res):
for name, device in res.items():
log.debug(name)
for service in device['services']:
log.debug(service)
if service == u'urn:av-openhome-org:service:Product:1':
d = controller.call(res, service, 'Product')
d.addCallback(show_product)
if service == u'urn:av-openhome-org:service:Playlist:1':
d = controller.subscribe(
res, service, 'Id', show, name)
# d.addCallback(show)
elif service == u'urn:schemas-upnp-org:service:SwitchPower:1':
d = controller.subscribe(
res, service, 'Status', show, name)
def test(controller):
controller.startService()
reactor.callLater( # @UndefinedVariable
50, lambda: log.debug(controller.devices))
reactor.callLater( # @UndefinedVariable
100, controller.stopService) # @UndefinedVariable
log.startLogging(sys.stdout)
controller = Controller(
searchables=[('upnp:rootdevice', search)],
network='cloud',
cloud_user=('[email protected]', 'test'))
reactor.callWhenRunning( # @UndefinedVariable
test, controller)
reactor.run() # @UndefinedVariable