At 05:14 PM 9/21/01 -0400, Martin Doudoroff wrote:
>We are developing a bunch of servlets and classes that are used in servlets,
>and we're having lots of trouble because we can't run webkit inside of a
>Does anyone have any solution to this? Can one hook the debugger (preferably
>the PythonWin one) into running servlets? Are there any alternatives?
>Yes, we know about print-ing messages to the console; that's not quite what
>we have in mind. We'd love to be able to watch the stack and snoop around
>inside of data structures.
I don't know of any way to attach a debugger to a running servlet. It
doesn't bother me very much because I personally usually find that
debugging by adding print statements is more effective for me.
If you're debugging an exception, turning on the "IncludeFancyTraceback"
option in Application.config helps a lot. This is available in Webware CVS.
If you're trying to debug logic problems that don't necessarily cause
exceptions, then my best suggestion is to try to restructure your code so
that the logic is contained in classes can be used totally independently of
Webware. Then you can debug those classes just like any other Python code,
write test suites, etc. Then your servlets are really just a web
presentation layer over your underlying logic.
I tend to use mixins for this. Then your servlets can multiple inherit
from your "logic" mixins and your SitePage class. But there are other ways
besides mixins to accomplish this.
Of course there's always print statements -- I use those quite often too :-)
- Geoff Talvola