I'm sad about logging.
Phillip Eby wrote some on this before. I have my own list of complaints about the PEP 282 logging implementation.
First-class
complaints:
- Never, ever, ever should a library print anything to stdout or stderr.
- Never, ever, ever should a library think it knows enough to register an atexit handler that calls potentially arbitrary code at interpreter shutdown.
- Never, ever should a library that allows you to pass a format string to it for serialization purposes add any other characters
to the serialization outside the format string (the logging module adds a linefeed to all message emissions).
Second-class
complaints:
- Libraries should not maintain global registries as a side effect of calling a constructor. I give asyncore a pass on this, so I won't be hypocritical and put this in "first-class complaints" ;-)
- Relatively simple libraries like this should not try to do thread locking. I'd rather not pay the performance price for this if I'm not using threads.
It might have been easier to write my own logging facility than to write this post.
Aaaaaand... that's what I did... http://cvs.plope.com/viewcvs/Packages/supervisor2/src/supervisor/loggers.py?rev=1.6&content-type=text/vnd.viewcvs-markup