[Zope-dev] New function for error log

2004-08-28 Thread Christian Theune
Hi.

I'm continuing to improve my small nagios plugin for Zope. I started to
include error messages in the sensor. Therefore I was missing a way to
get error messages out of the error log to signal nagios that everything
is fine. I have a working patch attached (it references an image that is
ready to be added as well).

Due to the fact that this is a feature and the code provides no unit
test infrastructure (and I don't have the time to start doing that for
the error log) I'd like to know what the general rule for Zope 2 is, If
I want to make improvements to existing code that isn't covered by unit
tests at all.

I'd check this in to the svn trunk if you like.

Cheers,
Christian

-- 
Christian Theune [EMAIL PROTECTED]
gocept gmbh  co. kg
? forgetEntries.patch
? www/ok.gif
Index: SiteErrorLog.py
===
RCS file: /cvs-repository/Products/SiteErrorLog/Attic/SiteErrorLog.py,v
retrieving revision 1.15.12.2
diff -r1.15.12.2 SiteErrorLog.py
122a123,137
 security.declareProtected(use_error_logging, 'forgetEntry')
 def forgetEntry(self, id):
 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()
 return Globals.MessageDialog(title='Entry removed',
 message='Error log entry was removed.',
 action='./manage_main',)
 
Index: __init__.py
===
RCS file: /cvs-repository/Products/SiteErrorLog/Attic/__init__.py,v
retrieving revision 1.3
diff -r1.3 __init__.py
19a20,24
 from ImageFile import ImageFile
 
 misc_={
 'ok.gif': ImageFile('www/ok.gif', globals()),
 }
Index: www/main.pt
===
RCS file: /cvs-repository/Products/SiteErrorLog/www/Attic/main.pt,v
retrieving revision 1.4
diff -r1.4 main.pt
71a72
   th/th
90a92
   tda 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
attachment: ok.gif

signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] New function for error log

2004-08-28 Thread Jens Vagelpohl
Due to the fact that this is a feature and the code provides no unit
test infrastructure (and I don't have the time to start doing that for
the error log) I'd like to know what the general rule for Zope 2 is, If
I want to make improvements to existing code that isn't covered by unit
tests at all.
That's an interesting question. What is the unit test policy if I 
change/improve a part of the Zope code that has no unit tests at all. 
Would I be expected to create unit tests for the whole thing all of a 
sudden?

I'm interested in seeing this patch in the core myself.
jens
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] New function for error log

2004-08-28 Thread Chris McDonough
On Sat, 2004-08-28 at 11:35, Jens Vagelpohl wrote:
  Due to the fact that this is a feature and the code provides no unit
  test infrastructure (and I don't have the time to start doing that for
  the error log) I'd like to know what the general rule for Zope 2 is, If
  I want to make improvements to existing code that isn't covered by unit
  tests at all.
 
 That's an interesting question. What is the unit test policy if I 
 change/improve a part of the Zope code that has no unit tests at all. 
 Would I be expected to create unit tests for the whole thing all of a 
 sudden?

In another post Tres' likened doing so to supererogation
(http://www.iep.utm.edu/s/superero.htm) which I think means to imply
that doing so will get you points in programmer heaven (well, depending
on your programmer dogma I suppose) but isn't strictly required.

I try to create at least *one* unit test for something that isn't tested
at all if I add a feature to it, testing my feature. ;-)  At least then
it gives people somewhere else to start.

- C


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )