[py-dev] Logging in the py library
Grig Gheorghiu
grig at gheorghiu.net
Sat Jun 11 01:09:32 CEST 2005
I just svn commit-ed 2 files: misc/log.py and misc/testing/test_log.py.
I tried to keep things as simple as possible and as close to the spirit
of py.trace as possible, while using the logging module as the
back-end. Please consider this experimental code. I'll be working on it
throughout the weekend.
Comments/suggestions are very welcome, vital actually :-)
Grig
--- holger krekel <hpk at trillke.net> wrote:
> 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 Pytest-dev
mailing list