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).

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to