Ticket #4676 enhancement closed duplicate
There's no api for setting components in a twistd plugin
| Reported by: | djfroofy | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | core | Keywords: | |
| Cc: | Branch: | ||
| Author: | Launchpad Bug: |
Description
Currently there's no api for setting the components in a twistd plugin. In .tac files, this is trivial:
application.setComponent(ILogObserver, PythonLoggingObserver().emit)
The only way I know how to do this is inheriting from MultiService:
class PythonLoggingMultiService(service.MultiService): def setServiceParent(self, parent): super(PythonLoggingMultiService, self).setServiceParent(parent) parent.setComponent(ILogObserver, PythonLoggingObserver().emit)
twistd plugins: http://twistedmatrix.com/documents/current/core/howto/tap.html
Change History
Note: See
TracTickets for help on using
tickets.
