In the logging howto documentation there is this example:
import logging
# create logger
logger = logging.getLogger(\'simple_example\')
logger.setLevel(l
Why I should set the level to logging.DEBUG twice, for logger, and for the streamhandler. I understand ch.setLevel(logging.DEBUG) will set the debug level for the stream handler. But what the effect is of setting the level to logger?. Where this level is reflected?.
This is indicated in the documentation:
"The setLevel() method, just as in logger objects, specifies the lowest severity that will be dispatched to the appropriate destination. Why are there two setLevel() methods? The level set in the logger determines which severity of messages it will pass to its handlers. The level set in each handler determines which messages that handler will send on."
Check under Handlers: http://docs.python.org/2.7/howto/logging.html#logging-advanced-tutorial