I was expecting this to work:
import logging
logger = logging.getLogger(__name__)
logger.warn('this is a warning')
instead it produced the error:
No handlers could be found for logger "__main__"
However, if instead I do:
import logging
logging.warn('creating logger')
logger = logging.getLogger(__name__)
logger.warn('this is a warning')
then it does work.
Is there any reason why getLogger()-created logger shouldn't
automatically create a default handler?
--
http://mail.python.org/mailman/listinfo/python-list