webdriver_manager icon indicating copy to clipboard operation
webdriver_manager copied to clipboard

Enable log (Log not showing in version 3.8.3)

Open MarcosBaungartner opened this issue 3 years ago • 8 comments

With version 3.8.3 the Log has stopped printing on the console window when executing a script. I tried to put this code in the beginning to no avail:

import os
os.environ['WDM_LOG'] = '1'

MarcosBaungartner avatar Aug 01 '22 18:08 MarcosBaungartner

It's not a problem if wdm. Maybe you have some redirects?

SergeyPirogov avatar Aug 01 '22 18:08 SergeyPirogov

I know, I just want it to show those information. It stopped showing after I updated to the latest version (3.8.3). I'm referring to that initial information which begins with "====== WebDriver manager ======" on the console.

MarcosBaungartner avatar Aug 02 '22 02:08 MarcosBaungartner

I'm using logging to log into a file. When I use: from webdriver_manager.chrome import ChromeDriverManager

logging does not work correctly anymore. It prints in the console instead of in the log file

faalbers avatar Aug 02 '22 03:08 faalbers

Please provide an example

SergeyPirogov avatar Aug 02 '22 11:08 SergeyPirogov

If you un comment the webdriver_manager import line, the logging will not go to the 'test.log' log file anymore. It will go to the console.

import logging
# from webdriver_manager.chrome import ChromeDriverManager

logging.basicConfig(filename='test.log', level=logging.INFO, format='%(message)s')

logging.info('Test line in log file')

faalbers avatar Aug 02 '22 15:08 faalbers

So, WDM 3.8.3 doesn't have this log printed on the console anymore?

Captura de tela 2022-08-02 201149

MarcosBaungartner avatar Aug 02 '22 23:08 MarcosBaungartner

I don't believe in this. We have tests and logs are present there. Go to github actions and see

SergeyPirogov avatar Aug 04 '22 06:08 SergeyPirogov

I see. But for me, there is no "INFO" printed on the console, despite this, it is working fine.

MarcosBaungartner avatar Aug 07 '22 03:08 MarcosBaungartner

@MarcosBaungartner please try to add pytest.ini file to your project and put the code inside

[pytest]
log_cli = 1
log_level = INFO

it works in all versions, now it works in 3.8.5

image

Have a nice day!

aleksandr-kotlyar avatar Feb 05 '23 14:02 aleksandr-kotlyar