Disable INFO Registration Messages in Ipython Laptop

I use request_throttler and request modules for communication through the API. My script is written in an Ipython Notebook. I get a lot of registration messages from the request_throttler module. How to disable or save file log messages in an ipython laptop? I got a message like:

INFO:requests_throttler.throttler:Starting base throttler 'base-throttler'... 

and you want to send thousands of requests, and this INFO message will kill my laptop.

+5
source share
2 answers

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

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

Setting logger.propagate to False suppresses the single remaining message "No handlers could be found for logger XYZ" , which you otherwise saw.

To save the file, open logging.FileHandler () .

+3
source

If you just want to disable all INFO entries in your Jupyter laptop, do the following inside your laptop:

 #Supress default INFO logging import logging logger = logging.getLogger() logger.setLevel(logging.CRITICAL) 
+2
source

All Articles