Attish
unread,Nov 8, 2009, 4:57:47 AM11/8/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web.py
I have also hit this problem, and I found a simple solution: create a
dummy
"file" class with only one method, a 'write()' that swallows all
output, or,
better optionally collects lines of output in a list for later
processing. Like
this:
class Logger():
def __init__(self, log=None):
self._log = log
def write(self, data):
if self._log is None:
return
self._log.append(data)
Then:
sys.stderr = Logger(log)
WebApp = web.application(urls, globals())
WebApp.run()
You can even have Logger.write() discriminate according to the error
code (e.g. don't log 200 OK, log all other messages).