[Python-Dev] PEP282 and the warnings framework

Vinay Sajip vinay_sajip@yahoo.co.uk
Wed, 22 May 2002 09:03:14 +0100


[Walter]
> Not with something like this:
> def log(self, lvl, msg, args, exc_info, eventtype=LogRecord):
>      if not isinstance(msg, LogRecord):
>          event = eventtype(msg, args)
> with this solution you can still use a string for msg.

This is equivalent to my suggestion: allow msg to be a class instance whose
__str__() returns the format string. I know it's slightly different, but you
can use it in the same sort of way, and we're discussing minor variations on
a theme.

[Walter]
> BTW, is there a public CVS repository for the logging module?

No - I don't think it warrants one, yet. I use version control so I can get
past versions, but it's not on CVS anywhere - it's not really been a shared
development as such, though a few people have been kind enough to submit
small patches.

If, as I hope, logging.py makes it into Python 2.3, it will be automatically
in Python's CVS and I won't need to trouble to create one just for
logging...

Regards

Vinay




_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com