Created
June 5, 2009 05:15
-
-
Save clemesha/124084 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
When I run this script with: | |
twistd -ny logobservermemfail.py | |
On OSX, using Twisted 8.2.0, Python 2.5, i see this error: | |
Python(12631) malloc: *** mmap(size=1275076608) failed (error code=12) | |
*** error: can't allocate region | |
*** set a breakpoint in malloc_error_break to debug | |
""" | |
from twisted.web import static, server | |
from twisted.application import service, internet | |
from twisted.python import log, logfile | |
class MyLogObserver(object): | |
def emit(self, eventDict): | |
print eventDict | |
root = static.File(".") | |
application = service.Application("App") | |
mlo = MyLogObserver() | |
application.setComponent(log.ILogObserver, mlo.emit) | |
site = server.Site(root) | |
service = internet.TCPServer(8888, site) | |
service.setServiceParent(application) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment