[Zope-Checkins] CVS: Zope/lib/python/ZPublisher - HTTPResponse.py:1.58
Andreas Jung
andreas@digicool.com
Fri, 12 Apr 2002 13:22:45 -0400
Update of /cvs-repository/Zope/lib/python/ZPublisher
In directory cvs.zope.org:/tmp/cvs-serv4425/lib/python/ZPublisher
Modified Files:
HTTPResponse.py
Log Message:
- new env. variable LOG_ZPUBLISHER_TRACEBACK
(see doc/ENVIRONMENT.txt)
=== Zope/lib/python/ZPublisher/HTTPResponse.py 1.57 => 1.58 ===
+#############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
@@ -16,6 +16,7 @@
__version__='$Revision$'[11:-2]
import types, os, sys, re
+import zLOG
from string import translate, maketrans
from types import StringType, InstanceType, LongType, UnicodeType
from BaseResponse import BaseResponse
@@ -175,7 +176,8 @@
if type(status) is types.StringType:
status=status.lower()
if status_codes.has_key(status): status=status_codes[status]
- else: status=500
+ else:
+ status=500
self.status=status
if reason is None:
if status_reasons.has_key(status): reason=status_reasons[status]
@@ -607,6 +609,10 @@
(str(t), b + self._traceback(t,'(see above)', tb, 0)),
is_error=1)
del tb
+
+ if os.environ.has_key('LOG_ZPUBLISHER_TRACEBACK'):
+ zLOG.LOG('zpublisher',zLOG.WARNING,'Traceback:',body)
+
return body
_wrote=None