In default settings, the Requests library continues to write log messages to the console (such as Starting new HTTP connection...), which is so annoying.
How can I set it so that it doesn't look like that?
python logging python-request
You must set the logging level of the request separately using the logging module.
I think it's right to send an error or warning separately, so I set it to log at least in warning.
import logging
logging.getLogger("requests").setLevel(logging.WARNING)
If you want to apply the same to urlib3 library, please add this too
logging.getLogger("urllib3").setLevel(logging.WARNING)
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
912 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
617 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.