[py-dev] Adding logdebug option to defaultconftest.py
holger krekel
hpk at trillke.net
Wed Jun 15 01:04:56 CEST 2005
On Tue, Jun 14, 2005 at 15:56 -0700, Grig Gheorghiu wrote:
> --- holger krekel <hpk at trillke.net> wrote:
> > I am starting to think about using
> > py.log here and there and it seems like i am actually going
> > for something like:
> >
> > class Something:
> > log = py.log.Producer('something')
> >
> > def method(self):
> > ...
> > self.log.adhoccategory("processing", x)
> >
> > this shows by default on stdout unless you set a catch-all
> > consumer or a specific one for e.g. 'something'.
> >
> > the "debugging" aspect then becomes a matter of defining
> > which logging information i care for (which could be changed
> > interactively or per command line switches as you suggested)
> > Do that make sense to you?
>
> Yes, it makes sense to me. I guess I was thinking more in terms of
> 'consumers' (which interface more heavily with the logging module),
> whereas you're approaching it in terms of 'agnostic' producers. So I
> think you're right, it doesn't make sense to burden the set_logger
> function with yet another parameter.
right, that's at least the experimental approach. We'll see how
it plays out.
> Maybe the logging level should only be a parameter to the specific
> loggers defined in consumer.py: File, Stdout, Stderr, Email, etc. Right
> now it's arbitrarily set to logging.DEBUG.
Doesn't the logging module offer the underlying output/formatting
logic in a more raw form, maybe? Or else, isn't the logic needed for
File, Stdout and Stderr trivial to implement? We then probably
don't need to bother with the logging module at all.
Btw, I don't know how the logging's email backend works but there
probably is some "commit()" like function that actually
triggers sending a mail, or not? I probably don't want an email
message on each logging entry :-)
holger
More information about the py-dev
mailing list