[Twisted-Python] (no subject)
Itamar Shtull-Trauring:
I'm pretty sure startLogging is called at some point on import? Or how is the default logging set up?
The twiddling of warnings is done during import, and the logfile is set to NullFile. The code looks like this (including the indentation level) import warnings warnings.showwarning = showwarning .... # Prevent logfile from being erased on reload. This only works in cpython. try: logfile except NameError: logfile = NullFile() logerr = sys.stderr The patch I submitted changes matters so that twiddling doesn't occur until startLogging is called. Also, Itamar said:
twisted.python.log is old and crufty. If anyone feels like updating it (requirements include different channels that can be logged to different files), feel free. If you do discuss it on the list first, to make sure everyone has voiced their requirements.
Python 2.3 has a generalized logging framework. http://python.org/dev/doc/devel/lib/module-logging.html ] New in version 2.3. This module defines functions and classes ] which implement a flexible error logging system for applications. Andrew dalke@dalkescientific.com
On Wed, 2 Apr 2003 18:48:46 -0500
Andrew Dalke
The patch I submitted changes matters so that twiddling doesn't occur until startLogging is called.
OK - we'll either do that or put this in twistd.
Python 2.3 has a generalized logging framework. http://python.org/dev/doc/devel/lib/module-logging.html ] New in version 2.3. This module defines functions and classes ] which implement a flexible error logging system for applications.
We are probably not going to use it - those of us who looked at it didn't seem to like it. -- Itamar Shtull-Trauring http://itamarst.org/ http://www.zoteca.com -- Python & Twisted consulting
On Wednesday, Apr 2, 2003, at 21:47 America/New_York, Itamar Shtull-Trauring wrote:
On Wed, 2 Apr 2003 18:48:46 -0500 Andrew Dalke
wrote: The patch I submitted changes matters so that twiddling doesn't occur until startLogging is called.
OK - we'll either do that or put this in twistd.
Python 2.3 has a generalized logging framework. http://python.org/dev/doc/devel/lib/module-logging.html ] New in version 2.3. This module defines functions and classes ] which implement a flexible error logging system for applications.
We are probably not going to use it - those of us who looked at it didn't seem to like it.
If only it had zope3 style XML configuration files with namespaces! -bob
participants (3)
-
Andrew Dalke
-
Bob Ippolito
-
Itamar Shtull-Trauring