I was using OpenAI module in my program. When I was doing logging in my program it was also logging the OpenAI requests, which I wanted to avoid.
I was doing this before
logger = logging.getLogger()
With this, I got the root logger and it was printing the logs of all modules in my program.
Now I am doing:
# Disable OpenAI and httpx logging
# Configure logging level for specific loggers by name
logging.getLogger("openai").setLevel(logging.ERROR)
logging.getLogger("httpx").setLevel(logging.ERROR)
# # Disable specific loggers by name
# logging.getLogger("openai").disabled = True
# logging.getLogger("httpx").disabled = True