improvements for the logging package

Grig Gheorghiu grig.gheorghiu at gmail.com
Wed Sep 7 17:14:24 EDT 2005


I recommend py.log (part of the py lib) as an example of a pythonic
implementation of logging. It uses a keyword-based mechanism and it
distinguishes between "producers" of log messages (i.e. your app) and
"consumers" of log messages (i.e. stdout, stderr, a database, a mail
server, etc.)

You can do things like:

>>> import py
>>> py.log.default('hello world')
[default] hello world
>>> log = py.log.Producer("myapp")
>>> log.info('hello again')
[myapp:info] hello again
>>> log.hello('again')
[myapp:hello] again

See
<http://agiletesting.blogspot.com/2005/06/keyword-based-logging-with-py-library.html>
for more details.

Grig




More information about the Python-list mailing list