[Python-Dev] Logging enhancements (original) (raw)

Vinay Sajip vinay_sajip at red-dove.com
Tue Jan 10 01:01:31 CET 2006


Hi Shane,

On 1/9/06, Shane Hathaway <shane at hathawaymix.org> wrote:

I'd like to create a patch for the logging package, but before I do, I need to know whether someone else is working on the package and whether my patch is likely to be accepted. Is there another group I should talk to?

I maintain the logging package, and I will happily review patches and apply them where I think they're fine. I have accepted many patches to the package, some via SF and some sent privately, but also rejected a few. For example, the TimedRotatingFileHandler was submitted by someone.

Patches need to be compatible with Python 1.5.2.

- The logging.config.fileConfig function has bare excepts that hide configuration errors. I'd like to remove the bare excepts and break up fileConfig for clarity.

I've no problem with this in principle, though there have been cases where ConfigParser behaviour is not what you would expect (e.g. a non-existent file leads to a "missing section" exception). I'd be grateful for more specifics as to where you have encountered problems.

- I'd like to make it possible to configure the format of exception tracebacks. Some logs want compressed tracebacks like Medusa; others want extra information like Zope.

Again, no problem in principle, but it's probably an unusual use case so any change should not require extra work for users without specialised requirements.

- There is no support for external log rotation. There is plenty of support for Python rotating logs directly, but permission settings often make that impossible. Long-running Python processes need to accept a signal which notifies them when an external tool rotates the logs.

I'd be interested in your approach to solve this.

- The logging documentation is lacking somewhat. For example, it fails to mention that the logging handlers are in the 'handlers' module, which I only learned by searching the source code.

Not true for this specific case - for example, http://docs.python.org/lib/module-logging.html has a list of 12 handlers, followed by a statement to the effect that all but StreamHandler and FileHandler are defined in the handlers module.

In general, patches are gratefully received! If you don't want to invest too much time up front, send me a mail indicating your general approach and we'll discuss.

Best regards,

Vinay Sajip



More information about the Python-Dev mailing list