Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
11250012
Commit
11250012
authored
Apr 04, 2002
by
Shane Hathaway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When displaying a traceback as text, show it alone with a text/plain content type.
parent
771cfd4d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
17 deletions
+21
-17
lib/python/Products/SiteErrorLog/SiteErrorLog.py
lib/python/Products/SiteErrorLog/SiteErrorLog.py
+14
-1
lib/python/Products/SiteErrorLog/www/showEntry.pt
lib/python/Products/SiteErrorLog/www/showEntry.pt
+7
-16
No files found.
lib/python/Products/SiteErrorLog/SiteErrorLog.py
View file @
11250012
...
...
@@ -13,7 +13,7 @@
##############################################################################
"""Site error log module.
$Id: SiteErrorLog.py,v 1.
2 2002/04/03 20:43:55
shane Exp $
$Id: SiteErrorLog.py,v 1.
3 2002/04/04 16:25:43
shane Exp $
"""
import
os
...
...
@@ -31,6 +31,7 @@ from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from
zExceptions.ExceptionFormatter
import
format_exception
from
zLOG
import
LOG
,
ERROR
# Permission names
use_error_logging
=
'Log Site Errors'
log_to_event_log
=
'Log to the Event Log'
...
...
@@ -204,6 +205,18 @@ class SiteErrorLog (SimpleItem):
return
entry
.
copy
()
return
None
security
.
declareProtected
(
use_error_logging
,
'getLogEntryAsText'
)
def
getLogEntryAsText
(
self
,
id
,
RESPONSE
=
None
):
"""Returns the specified log entry.
Makes a copy to prevent changes. Returns None if not found.
"""
entry
=
self
.
getLogEntryById
(
id
)
if
entry
is
None
:
return
'Log entry not found or expired'
if
RESPONSE
is
not
None
:
RESPONSE
.
setHeader
(
'Content-Type'
,
'text/plain'
)
return
entry
[
'tb_text'
]
Globals
.
InitializeClass
(
SiteErrorLog
)
...
...
lib/python/Products/SiteErrorLog/www/showEntry.pt
View file @
11250012
...
...
@@ -34,25 +34,16 @@ The specified log entry was not found. It may have expired.
</tr>
</table>
<div tal:condition="python: entry['tb_html'] and
not request.get('show_entry_as_text')">
<div tal:content="structure entry/tb_html">
Traceback
<div tal:condition="entry/tb_html" tal:content="structure entry/tb_html">
Traceback (HTML)
</div>
<pre tal:condition="not:entry/tb_html" tal:content="entry/tb_text">
Traceback (text)
</pre>
<p tal:condition="entry/tb_text"><a href="" tal:attributes="href
string:
showEntry?id=${entry/id}&show_entry_as_text=1
">Display
string:
getLogEntryAsText?id=${entry/id}
">Display
traceback as text</a></p>
</div>
<div tal:condition="python: not entry['tb_html'] or
request.get('show_entry_as_text')">
<pre tal:content="entry/tb_text">
Traceback
</pre>
<p tal:condition="entry/tb_html"><a href="" tal:attributes="href
string:showEntry?id=${entry/id}">Display
traceback as HTML</a></p>
</div>
<div tal:condition="entry/req_html">
<h3>REQUEST</h3>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment