How to suppress logging in WebDriverMangager for Python?
Asked Answered
C

4

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?

Constitutive answered 12/3, 2021 at 11:58 Comment(0)
S
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

Sport answered 14/3, 2021 at 10:59 Comment(3)
Thanks, but the logging comes from WebDriver manager, I don't have access to its log settings.Katzir
@MateMrše Were you trying my suggestion? Logger is global for the whole application. So altered changes should apply all over thewhole applicationSport
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.Katzir
A
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"
Andros answered 3/6, 2022 at 9:14 Comment(0)
P
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

Plott answered 16/10, 2021 at 8:8 Comment(0)
S
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

Sport answered 14/3, 2021 at 10:59 Comment(3)
Thanks, but the logging comes from WebDriver manager, I don't have access to its log settings.Katzir
@MateMrše Were you trying my suggestion? Logger is global for the whole application. So altered changes should apply all over thewhole applicationSport
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.Katzir
S
0

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

logging.basicConfig(level=logging.INFO)
Saline answered 20/6, 2023 at 5:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.