[Zope] Output debug info

Chris Withers chrisw@nipltd.com
Tue, 11 Sep 2001 10:40:47 +0100


Frank Stephan wrote:
> 
> is there a way to output my own debug info to console
> like I can with System.out.println() in Java?

in python products you can use 'print', but that's 'bad' in production code.

Much more safely:

from zLOG import LOG,INFO

LOG('an identifier',
    INFO,
    'Your message here',
    error = sys.exc_info())

The error bit is optional but is very cool when catching exceptions since it
causes the traceback to be logged :-)

cheers,

Chris