[issue31732] Add TRACE level to the logging module

2017-11-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Perhaps a recipe should be published to explain how to add your own levels? >>> import logging >>> logging.NOTE = logging.INFO + 5 >>> logging.addLevelName(logging.INFO + 5, 'NOTE') >>> class MyLogger(logging.getLoggerClass()): ...:def note(self, msg, *args

[issue31732] Add TRACE level to the logging module

2017-11-28 Thread Antoine Pitrou
Change by Antoine Pitrou : -- Removed message: https://bugs.python.org/msg307162 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue31732] Add TRACE level to the logging module

2017-11-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Perhaps a recipe should be published to explain how to add your own levels? e.g.: >>> import logging >>> logging.NOTE = logging.INFO + 5 >>> logging.addLevelName(logging.INFO + 5, 'NOTE') >>> class MyLogger(logging.Logger): ...:def note(self, msg, *args, *

[issue31732] Add TRACE level to the logging module

2017-10-14 Thread R. David Murray
R. David Murray added the comment: I'm not arguing against the rejection, but I want to mention a point in relation to Raymond's statement "five levels have sufficed for a long and that the need for finer distinctions almost never arises in practice". In thinking about my own codebase, I hav

[issue31732] Add TRACE level to the logging module

2017-10-13 Thread STINNER Victor
STINNER Victor added the comment: Vinay: > I feel that there is no need for a TRACE level in the stdlib Ok, that's fine. I just pushed the idea of someone on IRC. Since I had the same idea once, I tried, but I lost :-) I can easily survive without TRACE in the stdlib ;-) Vinay: > Victor say

[issue31732] Add TRACE level to the logging module

2017-10-13 Thread Vinay Sajip
Vinay Sajip added the comment: 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 b

[issue31732] Add TRACE level to the logging module

2017-10-12 Thread pmpp
pmpp added the comment: Sorry, i didn't mean to be rude. Just wanted to pick your attention because i think you miss the point: logging as is it with its levels is perfect for *log messages*. Review the typical usage shown and you'll see that tracing level is for logging tracebacks : the deb

[issue31732] Add TRACE level to the logging module

2017-10-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: No need to be brusque with me. Vinay is the decision maker on this. Overall, this seems rehash and second guess the discussions and decisions made 15 years ago when PEP 282 was accepted. At that time, it was decided that five levels had advantages for le

[issue31732] Add TRACE level to the logging module

2017-10-12 Thread pmpp
pmpp added the comment: As a dumb user I vote in favor of this on the ground that five levels is not sufficient for a long and that the need for finer distinctions already arose for me in practice. Till i overcame the mental cost to think, learn and *find time* on how to make a finer level o

[issue31732] Add TRACE level to the logging module

2017-10-12 Thread STINNER Victor
STINNER Victor added the comment: Raymond Hettinger: "... the need for finer distinctions almost never arises in practice" I gave a list of 10 projects which are alreading using widely the 6th TRACE level. In this list, I consider that OpenStack and SaltStack are two big and serious project

[issue31732] Add TRACE level to the logging module

2017-10-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: I vote against this on the ground that five levels have sufficed for a long and that the need for finer distinctions almost never arises in practice. There would be an ongoing mental cost to making users learn and think about finer levels of distinction.

[issue31732] Add TRACE level to the logging module

2017-10-09 Thread STINNER Victor
STINNER Victor added the comment: More references to TRACE logging level: * "CUSTOM_TRACE = 5 # Mapping for zLOG.TRACE" in Zope zLOG https://github.com/zopefoundation/zLOG/blob/master/src/zLOG/EventLogger.py#L29 * Runlevel = stem.util.enum.UppercaseEnum('TRACE', 'DEBUG', 'INFO', 'NOTICE', '

[issue31732] Add TRACE level to the logging module

2017-10-09 Thread STINNER Victor
STINNER Victor added the comment: Other references to a TRACE logging level: * SaltStack: trace = 5 https://docs.saltstack.com/en/latest/ref/configuration/logging/#log-levels * autologging.TRACE = 1: "A custom tracing log level, lower in severity than logging.DEBUG." autologging: "Autolog

[issue31732] Add TRACE level to the logging module

2017-10-09 Thread STINNER Victor
STINNER Victor added the comment: Attached PR 3930 adds logging.TRACE, logging.trace() and logging.Logger.trace(). -- nosy: +vinay.sajip ___ Python tracker ___

[issue31732] Add TRACE level to the logging module

2017-10-09 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +3905 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-li

[issue31732] Add TRACE level to the logging module

2017-10-09 Thread STINNER Victor
New submission from STINNER Victor : The logging module has already 5 log levels: CRITICAL, ERROR, WARNING, INFO, DEBUG. https://docs.python.org/dev/library/logging.html#logging-levels (I don't count NOTSET, I don't consider it to be "usable", at least not in an application or a library.) For