1
我嘗試寫一個扭曲的小服務。添加第二個ILogObserver到服務
我創建了一個簡單的應用程序,並嘗試將2個ILogObservers添加到我的服務中。但不幸的是,它不起作用。最後添加的Observer始終是將要使用的觀察者。
def log(eventDict):
...
def mylog(eventDict):
...
LoopingCall(logSomething).start(1)
application = Application("twistd-logging")
application.setComponent(ILogObserver, log)
application.setComponent(ILogObserver, mylog)
在此先感謝您的幫助。