classification
Title: No handlers could be found for logger
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: vinay.sajip Nosy List: purpleidea, vinay.sajip
Priority: normal Keywords:

Created on 2009-08-03 17:04 by purpleidea, last changed 2009-08-05 21:07 by purpleidea. This issue is now closed.

Messages (3)
msg91231 - (view) Author: James (purpleidea) Date: 2009-08-03 17:04
I was trying to suppress the error message as shown in the title, when I
found out (by searching through the source) that there is a NullHandler
for precisely this purpose.

http://svn.python.org/view/python/trunk/Lib/logging/__init__.py?r1=66211&r2=67511

do you think that:
1) this could be documented maybe here (
http://docs.python.org/library/logging.html#handler-objects ) i suppose?
and:
2) this null handler doesn't seem to exist in:
Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49) 
[GCC 4.3.2] on linux2
is this likely to get backported to 2.5? at the moment i've just
included the simple NullHandler class into my code.
3) also not my business really, but should it belong in the handlers.py
file?

thanks for all your hard work, i hope the comments are useful!
msg91329 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2009-08-05 19:45
1) It's not appropriate to document NullHandler at the point you
describe, as that's the API for Handlers. However, it is documented at

http://docs.python.org/library/logging.html#configuring-logging-for-a-library

I will check that NullHandler is added to documentation where the
available handler classes are listed.

2) Unlikely to be backported to 2.5, as it's a new feature (2.5
documentation tells how to create the class in user's own code).

3) NullHandler was placed in the main logging package along with the
other "elementary" handlers which are likely to be of most general use -
the handlers.py module is intended for more specialised handlers.
msg91336 - (view) Author: James (purpleidea) Date: 2009-08-05 21:07
very well,
i didn't notice the
http://docs.python.org/library/logging.html#configuring-logging-for-a-library
and i thank you for your time and efforts!

cheers,
_J
History
Date User Action Args
2009-08-05 21:07:47purpleideasetmessages: + msg91336
2009-08-05 19:45:54vinay.sajipsetstatus: open -> closed

messages: + msg91329
2009-08-04 20:12:49amaury.forgeotdarcsetassignee: vinay.sajip

nosy: + vinay.sajip
2009-08-03 17:04:09purpleideacreate