[PEAK] peak.running.logs in .ini files
Radek Kanovsky
rk at dat.cz
Wed Aug 4 07:56:06 EDT 2004
On Tue, Aug 03, 2004 at 09:44:03AM -0400, Phillip J. Eby wrote:
> > class Log (binding.Component) :
> > logger = binding.Obtain(PropertyName("peak.logs.test"))
>
> Please don't use 'peak.logs' PropertyNames to look up loggers; this may not
> work correctly in future versions of PEAK. Instead, use a 'logger:logname'
> URL, e.g.:
>
> logger = binding.Obtain("logger:test")
Yes, I remember your post about this. There was a problem with
TransactionService's logger that threw ImportError during logging
so I have created this simple test application and it showed the
same behaviour. TransactionService's logger is defined exactly as
binding.Obtain(PropertyName('peak.logs.transaction')) :-)
> >It relates to 'logs' appearance in .ini files and probably to its laziness.
> >There are at least two solutions how to bypass this error:
> >
> >1. Reload lazy peak.running module before accessing lazy logs
> > from any .ini file (by uncommenting dir(running) in example)
> >
> >2. Redefine peak.logs.* property in .ini file, so definition doesn't rely
> > on lazy logs.
> >
> > [peak.logs]
> > * = importString("peak.running.logs.LogStream")(
> > stream=sys.stderr, levelName='WARNING'
> > )
>
> I'll take a look at this and see what I can find out.
ImportError is raised by reload in util/imports.py:195. It denies to
reload lazyModule('peak.running.logs') although this module seems OK.
I was not able to find what's wrong yet.
RadekK
More information about the PEAK
mailing list