My logging setting look like
import requests
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('BBProposalGenerator')
When I run this, I get logs as
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): localhost
INFO:BBProposalGenerator:created proposal: 763099d5-3c8a-47bc-8be8-b71a593c36ac
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): localhost
INFO:BBProposalGenerator:added offer with cubeValueId: f23f801f-7066-49a2-9f1b-1f8c64576a03
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): localhost
INFO:BBProposalGenerator:evaluated proposal: 763099d5-3c8a-47bc-8be8-b71a593c36ac
How can I suppress the log statements from requests
package? so that I only see logs from my code
INFO:BBProposalGenerator:created proposal: 763099d5-3c8a-47bc-8be8-b71a593c36ac
INFO:BBProposalGenerator:added offer with cubeValueId: f23f801f-7066-49a2-9f1b-1f8c64576a03
INFO:BBProposalGenerator:evaluated proposal: 763099d5-3c8a-47bc-8be8-b71a593c36ac
logging.getLogger('requests').setLevel(logging.ERROR)
? – Janelljanellarequests
module only. The title, which brought me here, refers to all 3rd-party libraries. @VinaySajip's answer below solved that issue for me. – Fujio