[issue14539] logging module: logger does not print log message with logging.INFO level

Vinay Sajip report at bugs.python.org
Tue Apr 10 09:34:00 CEST 2012


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:

You haven't configured any handlers for the logger, so by default it wouldn't actually log anything. However, when no handlers are configured, logging uses an internal "last resort" handler to print the message to sys.stderr, and this handler has a threshold of WARNING (it's meant to print stdlib warnings and errors when no handlers are configured by an application).

If you add the lines, you should see something like this:

>>> logging.basicConfig(level=logging.INFO, format='%(message)s')
>>> logging.info('info message')
info message

See

http://docs.python.org/py3k/howto/logging.html#what-happens-if-no-configuration-is-provided

for more information.

----------
assignee:  -> vinay.sajip
resolution:  -> invalid
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14539>
_______________________________________


More information about the Python-bugs-list mailing list