I do pretty much the same things myself.  I assign sys.stderr = sys.stdout,
then I create my own log file object from a module I wrote a few years ago,
and then assign something like sys.stderr = self.logObj.

That works well for any errors that occur after those assignments have
occurred but doesn't do much for anything that happens earlier.

I also run the python code outside of Zope to get it all working.

It's just a pain when I have to make some minor change in the Zope to
External Method logic and it breaks.  That's where I start to lose it some
in the debugging.

Using something like:

        import sys, traceback, string
                type, val, tb = sys.exc_info()
sys.stderr.write(string.join(traceback.format_exception(type, val, tb), ''))
                del type, val, tb

...helps, but even with that I seem to get errors that I just can't seem to
catch and report properly.

I'm not sure what you are referring to with "...the Python debugger
"pdb"...".  I've never used it.

Thanks for your help,

Robert J. Roberts

-----Original Message-----
From: Dieter Maurer [mailto:[EMAIL PROTECTED]]
Sent: Saturday, October 14, 2000 1:51 PM
Subject: Re: [Zope] Help Debugging External Methods

 > What are my options for debugging External Methods in Zope running on
 > Windows NT?
I work under Unix. Maybe my technics are not applicable for NT.

Usually, I use "print" statements for debugging purposes.
Under Unix, I can redirect "stdout" to a file and
view the output (be sure to flush stdout after "print").

You can also use "zLog" (may be spelled differently!).
This writes log entries into the log file.
The advantages: will work under Windows, contains a timestamp.

If the external method does not need too many Zope infrastructure,
I test it outside of Zope and integrate only, when it works

When everything else does not work, I use "Test.py" and
the Python debugger "pdb".


Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to