[Zope-Checkins] CVS: Zope/lib/python/Products/SiteErrorLog/www - showEntry.pt:1.1.2.1 main.pt:1.1.2.2

Shane Hathaway shane@cvs.zope.org
Wed, 3 Apr 2002 14:45:04 -0500


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

Modified Files:
      Tag: shane-better-tracebacks-branch
	main.pt 
Added Files:
      Tag: shane-better-tracebacks-branch
	showEntry.pt 
Log Message:
The site error log product now shows the log and the tracebacks through the
web.


=== Added File Zope/lib/python/Products/SiteErrorLog/www/showEntry.pt ===
<h1 tal:replace="structure here/manage_page_header">Header</h1>
<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>



=== Zope/lib/python/Products/SiteErrorLog/www/main.pt 1.1.2.1 => 1.1.2.2 ===
   </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>