[Zope-Checkins] CVS: Releases/Zope/lib/python/Products/SiteErrorLog - SiteErrorLog.py:1.15
Evan Simpson
evan@zope.com
Fri, 7 Feb 2003 13:16:38 -0500
Update of /cvs-repository/Releases/Zope/lib/python/Products/SiteErrorLog
In directory cvs.zope.org:/tmp/cvs-serv25497
Modified Files:
SiteErrorLog.py
Log Message:
Make log entries for NotFound more useful and readable.
=== Releases/Zope/lib/python/Products/SiteErrorLog/SiteErrorLog.py 1.14 => 1.15 ===
--- Releases/Zope/lib/python/Products/SiteErrorLog/SiteErrorLog.py:1.14 Sun Jan 5 11:19:57 2003
+++ Releases/Zope/lib/python/Products/SiteErrorLog/SiteErrorLog.py Fri Feb 7 13:16:37 2003
@@ -151,6 +151,10 @@
username = None
userid = None
req_html = None
+ try:
+ strv = str(info[1])
+ except:
+ strv = '<unprintable %s object>' % type(info[1]).__name__
if request:
url = request.get('URL', '?')
usr = getSecurityManager().getUser()
@@ -160,11 +164,13 @@
req_html = str(request)
except:
pass
-
- try:
- strv = str(info[1])
- except:
- strv = '<unprintable %s object>' % str(type(info[1]).__name__)
+ if strtype == 'NotFound':
+ strv = url
+ next = request['TraversalRequestNameStack']
+ if next:
+ next = list(next)
+ next.reverse()
+ strv = '%s [ /%s ]' % (strv, '/'.join(next))
log = self._getLog()
entry_id = str(now) + str(random()) # Low chance of collision