
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
How do I disable log messages from the Requests Python module?
You can disable logging from the requests module using the logging module.
Example
You can configure it to not log messages unless they are at least warnings using the following code:
import logging logging.getLogger("requests").setLevel(logging.WARNING)
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.
- Related Articles
- How do I unload (reload) a Python module?
- How do I find the location of Python module sources?
- How do I find the current module name in Python?
- How do I calculate the date six months from the current date using the datetime Python module?
- How to enable/disable log levels in Android?
- How do I print debug messages in the Google Chrome JavaScript Console?
- How do I disable Strict Mode in MySQL?
- How I can dynamically import Python module?
- How can I read SMS messages from the device programmatically in Android?
- How to disable the minor ticks of a log-plot in Matplotlib?
- How do I show logarithmically spaced grid lines at all ticks on a log-log plot using Matplotlib?
- How I can install unidecode python module on Linux?
- How do I Input a String From the User in Python?
- How to call Python module from command line?
- How do I paste the copied text from the keyboard in Python?

Advertisements