[Zope-dev] Logging for ZScheduler?

Michel Pelletier michel@digicool.com
Fri, 16 Jun 2000 13:07:40 -0700


Loren Stafford wrote:
> 
> Not knowing what subsystem was for, I just filled it with __name__. So a log
> entry looks like this:
> 
> ------
> 2000-06-14T20:05:22 INFO(0) Products.ZScheduler.Loggerr
> Trigger event: http://eagle:8080/zev3
> Trigger time: 1970/12/31  16:00:00 US/Pacific
> Bang!
> 
> ------

This is a fine usage of subsystem.  The idea is to identify which
component logged the message.  __name__ does that pretty well.  In the
past, we've just used a simple string, like 'zdeamon'.

Does anyone object to making __name__ the convention?  I like it.  It
lets you find the object in the code and tell you where to set
breakpoints in the debugger pretty clearly without having to hunt.  But
perhaps there is something more interesting in some cases, like the
physical location of an object in the database if it is persistent.  I
kinda like:

subsys = string.join(self.getPhysicalPath(), '/') + ":" + `self`

This is probably 2.2 specific.

-- 

-Michel Pelletier

http://www.zope.org/Members/michel/MyWiki

Visit WikiCentral for the latest Zen:

http://www.zope.org/Members/WikiCentral