5

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?

Mate Mrše
  • 7,997
  • 10
  • 40
  • 77

4 Answers4

4

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"
Alex R.
  • 467
  • 3
  • 14
3

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

gore
  • 551
  • 2
  • 20
2

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

Yevhen B
  • 306
  • 1
  • 4
  • Thanks, but the logging comes from WebDriver manager, I don't have access to its log settings. – Mate Mrše Mar 15 '21 at 09:50
  • @MateMrše Were you trying my suggestion? Logger is global for the whole application. So altered changes should apply all over thewhole application – Yevhen B Mar 15 '21 at 17:46
  • Thanks, but I haven't been able to make it work. The problem is that the root logger has always been interfering with the custom one. Solved it with creating a separate logger. – Mate Mrše Mar 17 '21 at 13:51
0

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

logging.basicConfig(level=logging.INFO)
Alan Fullmer
  • 1,086
  • 9
  • 8