This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vinay.sajip
Recipients pmpp, rhettinger, vinay.sajip, vstinner
Date 2017-10-13.07:41:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1507880494.38.0.213398074469.issue31732@psf.upfronthosting.co.za>
In-reply-to
Content
As Raymond has said: though it might appear reasonable to add a TRACE level from the numerous examples that Victor has given, in practice it is hard enough to know when a particular level should be applied. Victor says "we need to a 6th level since DEBUG might be too verbose" - but as the PR is currently constituted, enabling the TRACE level would output DEBUG messages too, and so be even more verbose than just DEBUG! In this case I feel that, when considering the number of levels, "less is more".

For specific applications different levels might be desirable, and the logging system makes this possible, though not at the level of convenience of having a trace() method on loggers. However, it's easy enough to provide your own subclass with that method, if you really need it that badly. Of course you can currently also do logger.log(TRACE, ...) without the need for any subclass or need to "patch the stdlib" (as per Victor's comment).

This is one of those areas where tastes differ - and it is IMO really just a matter of taste. The five levels we have presently are based on what was considered best practice when the logging module was added to Python, and it specifically eschewed adopting prior art where more levels were available (e.g. syslog). The documentation gives a clear rationale for when to use what level:

https://docs.python.org/2/howto/logging.html#when-to-use-logging

and this seems of reasonably universal applicability across projects.

Given that individual projects *can* provide additional levels according to their need, I feel that there is no need for a TRACE level in the stdlib; as Raymond has pointed out in msg304304, the current levels are easy to understand when to apply, and finer levels invariably lead to different opinions on when to use them, due to essentially being matters of taste.
History
Date User Action Args
2017-10-13 07:41:34vinay.sajipsetrecipients: + vinay.sajip, rhettinger, vstinner, pmpp
2017-10-13 07:41:34vinay.sajipsetmessageid: <1507880494.38.0.213398074469.issue31732@psf.upfronthosting.co.za>
2017-10-13 07:41:34vinay.sajiplinkissue31732 messages
2017-10-13 07:41:33vinay.sajipcreate