Skip to content Skip to sidebar Skip to footer

Disable Info Logging Messages In Ipython Notebook

I'm using requests_throttler and requests modules for communication through API. My script are writen in Ipython Notebook. I'm getting a lot of logging messages from requests_throt

Solution 1:

If you just want to disable all INFO loggings in Jupyter Notebook just do the following inside your notebook:

#Supress default INFO logging

import logging
logger = logging.getLogger()
logger.setLevel(logging.CRITICAL)

Solution 2:

For Python 3 you can simply do:

import logging, sys
logging.disable(sys.maxsize)

Solution 3:

This worked for me under Python 2.7. (Other suggestions welcomed!)

importlogginglogger= logging.getLogger('requests_throttler')
logger.addHandler(logging.NullHandler())
logger.propagate = False

Setting logger.propagate to False suppresses the lone remaining "No handlers could be found for logger X.Y.Z" message that you'd otherwise see.

To save to a file, check out logging.FileHandler().

Post a Comment for "Disable Info Logging Messages In Ipython Notebook"