[py-dev] Logging in the py library
holger krekel
hpk at trillke.net
Thu Jun 9 12:05:06 CEST 2005
Hi Grig, hi all,
On Tue, Jun 07, 2005 at 18:51 +0200, holger krekel wrote:
> On Tue, Jun 07, 2005 at 09:46 -0700, Grig Gheorghiu wrote:
> > Holger,
> >
> > I think it makes a lot of sense to split the functionality between a
> > very simple 'producer' API that is exposed to end-users and a
> > potentially more complicated 'consumer' API that interfaces with the
> > logging module. It's pretty clear you spent time thinking about all
> > these things :-), so I think it would probably be best if you came up
> > with a first cut at the 'producer' API and at how things tie together.
> > Then I'd be glad to work on the 'back-end' API that interfaces with the
> > logging module. Would that work for you?
>
> Hehe, i guess so. Let me bet - for the fun of it - that the
> producer+consumer API implementation roughly described in the
> last mail will not exceed 70 lines of code :-)
Ok, done that. It's at 54 lines of code but i feel it's already
too convoluted. You'll find the code in py/misc/trace.py and
py/misc/testing/test_trace.py shows some usages.
The main missing piece involves thinking more about the dispatching
(possibly based on partial keyword matches) and the actual
API / namespace organization, for example of where to offer
logging-module adapter functions.
Please consider this trace.py experimental. But it hopefully
gives a more concrete clue of the ideas. Feedback or suggestions
very welcome (i think especially by using it a bit here and there
we could gain insights/better approaches).
cheers,
holger
More information about the py-dev
mailing list