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)
709 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
546 Understanding How to Configure Google API Key
542 Unable to install versioned in Google Colab
549 PHP ssh2_scp_send fails to send files as intended
537 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.