[issue16539] Turn off 'No handlers could be found for logger' message
New submission from anatoly techtonik: It is very annoying. Take this as an example. 'patch' is a module (library) that is meant to be used from other programs. Therefore it can not (should not) setup handlers for itself. import patch patch.PatchSet().parse('7745') No handlers could be found for logger patch Is it the same for Python 3? -- components: Library (Lib) messages: 176170 nosy: techtonik, vinay.sajip priority: normal severity: normal status: open title: Turn off 'No handlers could be found for logger' message versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16539 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16539] Turn off 'No handlers could be found for logger' message
anatoly techtonik added the comment: Forgot to mention that bundled NullHandler doesn't work in Python 2.7 and from what I can see it is not covered with tests for this version. Traceback (most recent call last): File stdin, line 1, in module File patch.py, line 124, in fromstring return PatchSet( StringIO(s) ) File patch.py, line 196, in __init__ self.parse(stream) File patch.py, line 512, in parse warning(error: no patch data found!) File C:\Python27\lib\logging\__init__.py, line 1152, in warning self._log(WARNING, msg, args, **kwargs) File C:\Python27\lib\logging\__init__.py, line 1258, in _log self.handle(record) File C:\Python27\lib\logging\__init__.py, line 1268, in handle self.callHandlers(record) File C:\Python27\lib\logging\__init__.py, line 1307, in callHandlers if record.levelno = hdlr.level: AttributeError: type object 'NullHandler' has no attribute 'level' -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16539 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16539] Turn off 'No handlers could be found for logger' message
anatoly techtonik added the comment: Nevermind the last message - I was specifying NullHandler as a class, not as an instance. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16539 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16539] Turn off 'No handlers could be found for logger' message
Vinay Sajip added the comment: This is not a valid issue. The approach to use is documented: http://docs.python.org/2.6/library/logging.html#configuring-logging-for-a-library http://docs.python.org/2.7/howto/logging.html#configuring-logging-for-a-library -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16539 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16539] Turn off 'No handlers could be found for logger' message
anatoly techtonik added the comment: I'd say this is a pretty valid issue with won't fix or workaround available resolution. The question - is the same behavior preserved for Python 3? -- resolution: invalid - wont fix status: closed - languishing ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16539 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16539] Turn off 'No handlers could be found for logger' message
Amaury Forgeot d'Arc added the comment: Python 3 has exactly the same documentation: http://docs.python.org/3.3/howto/logging.html#configuring-logging-for-a-library -- nosy: +amaury.forgeotdarc resolution: wont fix - works for me status: languishing - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16539 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com