[Zope] Write log file from script

Dieter Maurer dieter at handshake.de
Sat Oct 8 06:24:20 EDT 2005


Brian Sullivan wrote at 2005-10-7 11:42 -0400:
>I am looking for a simple strategy to write a debug log file from a python
>script.

In an External Method (trusted code), you can write files
as usual in Python. An elementary log function could be:

   def log(msg):
     open(LOGFILE, "a").write(msg)


You cannot use "open" in untrusted code (for obvious reasons).

-- 
Dieter


More information about the Zope mailing list