[Zope-CMF] Re: [dev] RFC: logging/reporting framework for
GenericSetup
Tres Seaver
tseaver at palladion.com
Thu Nov 17 08:41:06 EST 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
yuppie wrote:
> Hi Tres!
>
>
> Tres Seaver wrote:
>
>>> Hmm, it seems like that landed in the project-local repository from
>>> which GenericSetup originally sprang, but *after* GenericSetup landed in
>>> CMF's repository. I'm attaching the patch:
>>>
>>> - It uses the '_notes' field both to create an OFS.Image.File log of
>>> import runs, as well as to display at the bottom of the "Import"
>>> tab.
>>>
>>> - It echoes logged messages to zLOG.
>>>
>>> - It expands ISetupContext's API with methods 'note', 'listNotes',
>>> and 'clearNotes'. Stock implementations of ths API are in a new
>>> 'SetupContextBase' class.
>>>
>>> Note that the patch doesn't apply cleanly to the GenericSetup trunk;
>>> I'll have to work out why if we chose to land it.
>>
>>
>> OK, I've landed it (it was easier than I expected) on a new branch:
>>
>> http://svn.zope.org/CMF/branches/tseaver-resync_GenericSetup
>
>
> I tried hard to make the I/O adapters reusable outside GenericSetup. To
> become more independent from ISetupContext I propose to move the logging
> API into a separate interface and class. ISetupContext would just have a
> getLogger() method.
>
> I'm also missing different logging levels. The python logging module has
> a nice generic API for that.
>
> So I propose to use the same interface for the GenericSetup specific
> logger, making it replaceable by a python logger if the I/O handlers are
> used in a different context.
>
>
> For example this code in content.py::
>
> import_context.note('SGAIFA',
> 'no .ini file for %s/%s' % (subdir, cid))
> would be replaced by this code::
>
> logger = import_context.getLogger('SGAIFA')
> logger.info('no .ini file for %s/%s' % (subdir, cid))
>
> If there are no objections I'd like to make those changes either on your
> branch or after you merged your changes into the trunk.
Go ahead and merge it to the branch -- I'll need to look at how the
generated report changes to reflect the level.
Tres.
- --
===================================================================
Tres Seaver +1 202-558-7113 tseaver at palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDfIhy+gerLs4ltQ4RAvdGAJ9b+jFJeqmbQlwbBvksd1m1YpHgoQCgjeyr
E81zqXx8qvWWNTgUHVyTwM8=
=1+Tm
-----END PGP SIGNATURE-----
More information about the Zope-CMF
mailing list