scrivenerTwisted Scribe Client/Server | |
Download |
scrivener Ranking & Summary
Advertisement
- License:
- The Apache License 2.0
- Price:
- FREE
- Publisher Name:
- David Reid
- Publisher web site:
- https://github.com/racker/
scrivener Tags
scrivener Description
scrivener is a Scribe server and client Python framework that can be used with Twisted apps.Client APIfrom twisted.internet import reactorfrom twisted.internet.endpoints import TCP4ClientEndpointfrom scrivener import ScribeClientdef main(): client = ScribeClient(TCP4ClientEndpoint(reactor, '127.0.0.1', 1234)) client.log('category', 'message1') client.log('category', 'message2')if __name__ == '__main__': reactor.callWhenRunning(main) reactor.run()Server APIimport sysfrom twisted.internet import reactorfrom twisted.internet.endpoints import TCP4ServerEndpointfrom twisted.python.log import startLoggingfrom scrivener import ScribeServerServicefrom scrivener.handlers import TwistedLogHandlerdef main(): service = ScribeServerService( TCP4ServerEndpoint(reactor, 1234), TwistedLogHandler()) service.startService()if __name__ == '__main__': startLogging(sys.stdout) reactor.callWhenRunning(main) reactor.run()Server Plugin> twistd -n scrivener --helpUsage: twistd scrivener Options: -p, --port= Port to listen on for scribe service. -H, --handlerFactory= Fully Qualified Name of a callable that returns an ILogHandler --version Display Twisted version and exit. --help Display this help and exit.> twistd -n scrivener -p 1234 -H example.MyLogHandlerProduct's homepage
scrivener Related Software