How do I disable log messages from the Requests Python module?

You can disable logging from the requests module using the logging module.


You can configure it to not log messages unless they are at least warnings using the following code:

import logging

If you want to go a level higher and only want to log messages when they are errors or critical, you can do replace logging.WARNING with logging.ERROR and logging.CRITICAL respectively.