Re: [Zope] Write log file from script

2005-10-10 Thread Chris Withers
Dave Kuhlman wrote: Why not zLOG? Look at: Zope-2.8.1-home/lib/python/zLOG/__init__.py Well, zLOG is hopefully going away some time soon ;-) You should really be using the python logging module, for which zLOG is now just a facade: import logging logger =

Re: [Zope] Write log file from script

2005-10-08 Thread Dieter Maurer
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)

Re: [Zope] Write log file from script

2005-10-07 Thread Jonathan
How about creating a string or list, then appending your debug info to the string/list, then returning the string/list to the calling routine which then displays the string/list? Jonathan - Original Message - From: Brian Sullivan To: zope@zope.org Sent: Friday,

Re: [Zope] Write log file from script

2005-10-07 Thread Dennis Allison
Depends upon what you want to do and how much access you have. For debugging purposes I often use an external procedure def debugWindow( data ): fd = open('/tmp/debugWindow,'a') fd.write( str(data)) fd.close() and look at the output with tail -f /tmp/debugWindow Or, you can

Re: [Zope] Write log file from script

2005-10-07 Thread Brian Sullivan
On 10/7/05, Dennis Allison [EMAIL PROTECTED] wrote: Depends upon what you want to do and how much accessyou have.Fordebugging purposes I often use an external procedure def debugWindow( data ):fd = open('/tmp/debugWindow,'a')fd.write( str(data))fd.close()and look at the output withtail -f

Re: [Zope] Write log file from script

2005-10-07 Thread Dave Kuhlman
On Fri, Oct 07, 2005 at 11:42:16AM -0400, Brian Sullivan wrote: I am looking for a simple strategy to write a debug log file from a python script. I used to have such a beast but somewhere in a shuffle it got lost -- and my brain seems to be dead this morning trying to figure it out.

Re: [Zope] Write log file from script

2005-10-07 Thread Tino Wildenhain
Am Freitag, den 07.10.2005, 09:03 -0700 schrieb Dennis Allison: Depends upon what you want to do and how much access you have. For debugging purposes I often use an external procedure def debugWindow( data ): fd = open('/tmp/debugWindow,'a') fd.write( str(data)) fd.close()

Re: [Zope] Write log file from script

2005-10-07 Thread Brian Sullivan
On 10/7/05, Tino Wildenhain [EMAIL PROTECTED] wrote: Am Freitag, den 07.10.2005, 09:03 -0700 schrieb Dennis Allison: Depends upon what you want to do and how much accessyou have.For debugging purposes I often use an external procedure def debugWindow( data ):fd =

Re: [Zope] Write log file from script

2005-10-07 Thread Dennis Allison
We are running on a linux host. The file information ends upon in the local file system in the /tmp directory. On Fri, 7 Oct 2005, Brian Sullivan wrote: On 10/7/05, Tino Wildenhain [EMAIL PROTECTED] wrote: Am Freitag, den 07.10.2005, 09:03 -0700 schrieb Dennis Allison: Depends upon

Re: [Zope] Write log file from script

2005-10-07 Thread Brian Sullivan
On 10/7/05, Dennis Allison [EMAIL PROTECTED] wrote: We are running on a linux host.The file information ends uponin the local file system in the /tmp directory. import zLOG def log(self,message): zLOG.LOG(PythonScript, zLOG.INFO http://zLOG.INFO, message) as external method should be