[issue8162] logging.disable() incoherency
New submission from Pascal Chambon chambon.pas...@gmail.com: Hello I see some trouble in the semantic of logging.disable(lvl) : according to the doc (and docstrings), it's the same as a logger.setLevel(lvl) called on all logger, but in reality it doesn't act the same way : when we call logger.setLevel(lvl), log messages at level lvl WILL be logged, whereas with logger.disable(lvl), they will NOT be logged (CF method below from logging/__init__.py). So maybe the best would be to explain that disable() also disable the target level itself, and to set by default this disabling level to -1 (and not 0 as currently), so that by default ALL messages get loged, even those set to level 0. def isEnabledFor(self, level): Is this logger enabled for level 'level'? if self.manager.disable = level: return 0 return level = self.getEffectiveLevel() -- assignee: georg.brandl components: Documentation, Library (Lib) messages: 101215 nosy: georg.brandl, pakal severity: normal status: open title: logging.disable() incoherency type: behavior versions: Python 2.6, Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8162 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8162] logging.disable() incoherency
Changes by Brian Curtin cur...@acm.org: -- nosy: +vinay.sajip priority: - normal versions: +Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8162 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8162] logging.disable() incoherency
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: I've updated the docstring and documentation to be more precise (r79026). -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8162 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8162] logging.disable() incoherency
Pascal Chambon chambon.pas...@gmail.com added the comment: Thanks you B-) I guess it's not important if messages of severity 0 will allways be ignored with the current semantic ? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8162 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8162] logging.disable() incoherency
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: - Original Message From: Pascal Chambon rep...@bugs.python.org I guess it's not important if messages of severity 0 will allways be ignored with the current semantic ? Levels are supposed to be positive integers, zero is a special value indicating a level that isn't set. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8162 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com