How to suppress logging in WebDriverMangager for Python?

2.4k Views Asked by At

There is a similar question here, but that is for Java.

I wish to suppress the following:

INFO:WDM:====== WebDriver manager ======
INFO:WDM:Current google-chrome version is 88.0.4324
INFO:WDM:Get LATEST driver version for 88.0.4324
INFO:WDM:Driver [C:\Users\user.name\.wdm\drivers\chromedriver\win32\88.0.4324.96\chromedriver.exe] found in cache

Is there a Python solution?

4

There are 4 best solutions below

3
On BEST ANSWER

Python maintains concept to logging similar to Java. So you can alter logger's default settings with ini file or hardcoding. You may choose new log error level ERROR or WARNING - messages with INFO and below will not be stored then

0
On

Seems it has been updated. New method to switch logs off:

import logging
import os

logging.getLogger('WDM').setLevel(logging.NOTSET)
os.environ['WDM_LOG'] = "false"
0
On

I had a similar problem, check to see if you have something similar in your code to this:

logging.basicConfig(level=logging.INFO)
0
On

Should be fixed already in 3.5.0 version of webdriver-manager.

Try to set env variable WDM_LOG_LEVEL=0

P.S. please feel free to come on project's GitHub and describe your issue. There have been done much work on disabling default wdm logging, but if you still have a problem - give to author and contributors an example of code you use and they will try to help. https://github.com/SergeyPirogov/webdriver_manager