[Zope-Checkins] CVS: Zope/lib/python/Products/SiteErrorLog/www - error.gif:1.2 main.pt:1.2 showEntry.pt:1.2

Shane Hathaway shane@cvs.zope.org
Wed, 3 Apr 2002 15:44:27 -0500


Update of /cvs-repository/Zope/lib/python/Products/SiteErrorLog/www
In directory cvs.zope.org:/tmp/cvs-serv3170/lib/python/Products/SiteErrorLog/www

Added Files:
	error.gif main.pt showEntry.pt 
Log Message:
Merged shane-better-tracebacks-branch.  The changes are explained in http://dev.zope.org/Wikis/DevSite/Proposals/BetterTracebacks

=== Zope/lib/python/Products/SiteErrorLog/www/error.gif 1.1 => 1.2 ===


=== Zope/lib/python/Products/SiteErrorLog/www/main.pt 1.1 => 1.2 ===
+<h1 tal:replace="structure here/manage_tabs">Tabs</h1>
+
+<p class="form-help">
+This page lists the exceptions that have occurred in this site
+recently.  You can configure how many exceptions should be kept
+and whether the exceptions should be copied to Zope's event log
+file(s).
+</p>
+
+<form action="setProperties" method="post">
+<table tal:define="props container/getProperties">
+  <tr>
+    <td align="left" valign="top">
+    <div class="form-label">
+    Number of exceptions to keep
+    </div>
+    </td>
+    <td align="left" valign="top">
+    <input type="text" name="keep_entries" size="40"
+           tal:attributes="value props/keep_entries" />
+    </td>
+  </tr>
+  <tr>
+    <td align="left" valign="top">
+    <div class="form-label">
+    Copy exceptions to the event log
+    </div>
+    </td>
+    <td align="left" valign="top">
+    <input type="checkbox" name="copy_to_zlog"
+           tal:attributes="checked props/copy_to_zlog;
+           disabled not:container/checkEventLogPermission|nothing" />
+    </td>
+  </tr>
+  <tr>
+    <td align="left" valign="top">
+    </td>
+    <td align="left" valign="top">
+    <div class="form-element">
+    <input class="form-element" type="submit" name="submit" 
+     value=" Save Changes " />
+    </div>
+    </td>
+  </tr>
+</table>
+
+<h3>Exception Log</h3>
+
+<div tal:define="entries container/getLogEntries">
+
+<em tal:condition="not:entries">
+No exceptions logged.
+</em>
+
+<table tal:condition="entries">
+ <tr>
+  <th align="left">Time</th>
+  <th align="left">User</th>
+  <th align="left">Exception</th>
+ </tr>
+ <tr tal:repeat="entry entries">
+  <td valign="top" nowrap="nowrap">
+   <span tal:content="python: DateTime(entry['time']).Time()">13:04:41</span>
+  </td>
+  <td>
+   <span tal:content="entry/username">joe</span>
+  </td>
+  <td valign="top">
+   <a href="showEntry" tal:attributes="href string:showEntry?id=${entry/id}"
+    >
+    <span tal:content="entry/type">AttributeError</span>:
+    <span tal:define="value entry/value"
+      tal:content="python: len(value) < 70 and value or value[:70] + '...'">
+      Application object has no attribute "zzope"</span>
+   </a>
+  </td>
+ </tr>
+</table>
+
+</div>
+
+</form>
+
+<p>
+<form action="manage_main" method="GET">
+<input type="submit" name="submit" value=" Refresh " />
+</form>
+</p>
+
+<h1 tal:replace="structure here/manage_page_footer">Footer</h1>
+


=== Zope/lib/python/Products/SiteErrorLog/www/showEntry.pt 1.1 => 1.2 ===
+<h1 tal:replace="structure here/manage_tabs">Tabs</h1>
+
+<h3>Exception traceback</h3>
+
+<div tal:define="entry python:container.getLogEntryById(request.get('id'))">
+
+<em tal:condition="not:entry">
+The specified log entry was not found.  It may have expired.
+</em>
+
+<div tal:condition="entry">
+
+<table>
+ <tr>
+  <th align="left" valign="top">Time</th>
+  <td tal:content="python: DateTime(entry['time'])"></td>
+ </tr>
+ <tr>
+  <th align="left" valign="top">User</th>
+  <td tal:content="entry/username">joe</td>
+ </tr>
+ <tr>
+  <th align="left" valign="top">Request URL</th>
+  <td tal:content="entry/url">http://example.com</td>
+ </tr>
+ <tr>
+  <th align="left" valign="top">Exception Type</th>
+  <td tal:content="entry/type">AttributeError</td>
+ </tr>
+ <tr>
+  <th align="left" valign="top">Exception Value</th>
+  <td tal:content="entry/value">zzope</td>
+ </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>
+<p tal:condition="entry/tb_text"><a href="" tal:attributes="href
+   string:showEntry?id=${entry/id}&show_entry_as_text=1">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>
+<div tal:replace="structure entry/req_html"></div>
+</div>
+
+</div>
+
+<p>
+<form action="manage_main" method="GET">
+<input type="submit" name="submit" value=" Return to log " />
+</form>
+</p>
+
+</div>
+
+<h1 tal:replace="structure here/manage_page_footer">Footer</h1>
+