-
-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
log_level not working #255
Comments
@suyashjawale what version of webdriver-manager do you use? |
webdriver-manager 3.5.1 |
Modified some code in logger.py file and the logs are silent. Instead of setting logger level to 0 set it to 100. |
I get the same result as you. With the code import os
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
def test():
os.environ['WDM_LOG_LEVEL'] = '0'
driver = webdriver.Chrome(ChromeDriverManager().install()) # console output
$ pytest tests/test_.py
=============================================================================== test session starts ================================================================================
platform darwin -- Python 3.7.2, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
rootdir: /Users/user/GitHubProjects/webdriver_manager, configfile: pytest.ini
plugins: cov-3.0.0
collected 1 item
tests/test_.py::test
---------------------------------------------------------------------------------- live log call -----------------------------------------------------------------------------------
INFO WDM:logger.py:24
INFO WDM:logger.py:24 ====== WebDriver manager ======
INFO WDM:logger.py:24 /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version
INFO WDM:logger.py:24 Google Chrome 94.0.4606.81
INFO WDM:logger.py:24 Current google-chrome version is 94.0.4606
INFO WDM:logger.py:24 Get LATEST chromedriver version for 94.0.4606 google-chrome
INFO WDM:logger.py:24 Driver [/Users/user/.wdm/drivers/chromedriver/mac64/94.0.4606.61/chromedriver] found in cache
PASSED [100%]
================================================================================ 1 passed in 2.40s ================================================================================= But interesting that when I use
# pytest.ini
[pytest]
env =
WDM_LOG_LEVEL=0 # test.py
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
def test():
driver = webdriver.Chrome(ChromeDriverManager().install()) # console output
$ pytest tests/test_.py
=============================================================================== test session starts ================================================================================
platform darwin -- Python 3.7.2, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
rootdir: /Users/user/GitHubProjects/webdriver_manager, configfile: pytest.ini
plugins: env-0.6.2, cov-3.0.0
collected 1 item
tests/test_.py . [100%]
================================================================================ 1 passed in 2.37s ================================================================================= |
Commented this line in my fork and the issue is resolved. Before passing value the _init_logger() initializes the loggers dictionary with logging.INFO level. which makes it unable to override the value. |
@suyashjawale Thank you for your job! I hope your PR will be merged soon. Please update your PR description with linkt to this issue, like:
|
self.driver = webdriver.Chrome(executable_path=ChromeDriverManager(cache_valid_range=10, log_level=0).install(),options=options)
I have use above arguments to silent the logs but its not working also I used
But nothing seems to work..
Any solution??
The text was updated successfully, but these errors were encountered: