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
6cbaa8aa
Commit
6cbaa8aa
authored
Aug 29, 2004
by
Christian Theune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- The SiteErrorLog now allows you to acknowledge exceptions.
parent
d0afb92a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
0 deletions
+49
-0
doc/CHANGES.txt
doc/CHANGES.txt
+5
-0
lib/python/Products/SiteErrorLog/SiteErrorLog.py
lib/python/Products/SiteErrorLog/SiteErrorLog.py
+16
-0
lib/python/Products/SiteErrorLog/__init__.py
lib/python/Products/SiteErrorLog/__init__.py
+5
-0
lib/python/Products/SiteErrorLog/tests/testSiteErrorLog.py
lib/python/Products/SiteErrorLog/tests/testSiteErrorLog.py
+21
-0
lib/python/Products/SiteErrorLog/www/main.pt
lib/python/Products/SiteErrorLog/www/main.pt
+2
-0
lib/python/Products/SiteErrorLog/www/ok.gif
lib/python/Products/SiteErrorLog/www/ok.gif
+0
-0
No files found.
doc/CHANGES.txt
View file @
6cbaa8aa
...
...
@@ -26,6 +26,11 @@ Zope Changes
Features added
- The SiteErrorLog allows you to acknowledge (or delete) exceptions,
so you can reduce or clear the list without restarting your
Zope server. Additionally the SiteErrorLog is covered by unit tests
now.
- UI improvement for the ZCatalog. The "catalog contents" allow
you to filter the cataloged objects by path now.
...
...
lib/python/Products/SiteErrorLog/SiteErrorLog.py
View file @
6cbaa8aa
...
...
@@ -120,6 +120,22 @@ class SiteErrorLog (SimpleItem):
# Exceptions that happen all the time, so we dont need
# to log them. Eventually this should be configured
# through-the-web.
security
.
declareProtected
(
use_error_logging
,
'forgetEntry'
)
def
forgetEntry
(
self
,
id
,
REQUEST
=
None
):
"""Removes an entry from the error log."""
log
=
self
.
_getLog
()
cleanup_lock
.
acquire
()
i
=
0
for
entry
in
log
:
if
entry
[
'id'
]
==
id
:
del
log
[
i
]
i
+=
1
cleanup_lock
.
release
()
if
REQUEST
is
not
None
:
return
Globals
.
MessageDialog
(
title
=
'Entry removed'
,
message
=
'Error log entry was removed.'
,
action
=
'./manage_main'
,)
_ignored_exceptions
=
(
'Unauthorized'
,
'NotFound'
,
'Redirect'
)
security
.
declarePrivate
(
'raising'
)
...
...
lib/python/Products/SiteErrorLog/__init__.py
View file @
6cbaa8aa
...
...
@@ -17,6 +17,11 @@ $Id$
"""
import
SiteErrorLog
from
ImageFile
import
ImageFile
misc_
=
{
'ok.gif'
:
ImageFile
(
'www/ok.gif'
,
globals
()),
}
def
initialize
(
context
):
context
.
registerClass
(
SiteErrorLog
.
SiteErrorLog
,
...
...
lib/python/Products/SiteErrorLog/tests/testSiteErrorLog.py
View file @
6cbaa8aa
...
...
@@ -61,6 +61,27 @@ class SiteErrorLogTests(unittest.TestCase):
# Now look at the SiteErrorLog, it has one more log entry
self
.
assertEquals
(
len
(
sel_ob
.
getLogEntries
()),
previous_log_length
+
1
)
def
testForgetException
(
self
):
elog
=
self
.
app
.
error_log
# Create a predictable error
try
:
raise
AttributeError
,
"DummyAttribute"
except
AttributeError
:
info
=
sys
.
exc_info
()
elog
.
raising
(
info
)
previous_log_length
=
len
(
elog
.
getLogEntries
())
entries
=
elog
.
getLogEntries
()
self
.
assertEquals
(
entries
[
0
][
'value'
],
"DummyAttribute"
)
# Kick it
elog
.
forgetEntry
(
entries
[
0
][
'id'
])
# Really gone?
self
.
assertEquals
(
len
(
elog
.
getLogEntries
()),
previous_log_length
-
1
)
def
testIgnoredException
(
self
):
# Grab the Site Error Log
sel_ob
=
self
.
app
.
error_log
...
...
lib/python/Products/SiteErrorLog/www/main.pt
View file @
6cbaa8aa
...
...
@@ -69,6 +69,7 @@ No exceptions logged.
<th align="left">Time</th>
<th align="left">Username (User Id)</th>
<th align="left">Exception</th>
<th></th>
</tr>
<tr tal:repeat="entry entries">
<td valign="top" nowrap="nowrap">
...
...
@@ -88,6 +89,7 @@ No exceptions logged.
Application object has no attribute "zzope"</span>
</a>
</td>
<td><a href="#" tal:attributes="href string:${here/absolute_url}/forgetEntry?id=${entry/id}"><img title="Forget this entry" src="/misc_/SiteErrorLog/ok.gif" border="0"></a></td>
</tr>
</table>
...
...
lib/python/Products/SiteErrorLog/www/ok.gif
0 → 100644
View file @
6cbaa8aa
335 Bytes
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