[Python-Dev] Re: PEP 282 comments (original) (raw)

Paul Svensson paul@svensson.org
Fri, 22 Mar 2002 15:06:06 -0500 (EST)


On Fri, 22 Mar 2002, Jeremy Hylton wrote:

This makes me want to ask a more fundamental question. What are the expected use cases for the standard logging module(s)? Who is the customer?

Not sure I can answer that question, but here's a little user story:

I'm currently involved in the development of a significantly sized 24/7/365 transaction processing system (not written in Python, unfortunately (not my decision)), with a need to log various anomalies in various ways. Somewhat simplified, we have five levels, CRITICAL, ERROR, WARNING, INFORMATION, and DEBUG, that need to be distributed to alarm panels, operator consoles, tech support pagers, daily reports, the hardware warehouse inventory system, and of course log files.

One practical thing in a large system is that the more severe a problem, the higher management gets involved in resolving it, and the simpler it needs to be presented to be understood. Thus, call tracebacks or similar intimate system details would never be shown with anything but a DEBUG level, so if the function used to log an exception should have a hardcoded a logging level, DEBUG would be the obvious one.

/Paul