-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
[🐛 Bug]: [py] Service logging to console not working correctly #15629
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
Comments
@cgoldberg, thank you for creating this issue. We will troubleshoot it as soon as we can. Selenium Triage Team: remember to follow the Triage Guide |
I think the code assumes: |
If that's true, then we need to update the code to support both. |
You're right, it works with I'll also add something to the documentation, because there is no example of how to get it to log to the console instead of a file. |
It should log to console by default? |
This issue is looking for contributors. Please comment below or reach out to us through our IRC/Slack/Matrix channels if you are interested. |
It doesn't log anywhere by default... to get driver logs you have create the That doesn't seem right .. it should follow the same logging configuration as everything else. But right now if I enable logging for everything else, I won't get driver logs unless I explicitly enable them. I don't think it always worked like this. |
I added driver logging functionality to all the languages that didn't have them a couple years ago. |
Description
(sorry for the vague title. I'll rename it once I figure out what is happening)
Something weird is going on when I enable logging to the console in the Service class.
The following code should work properly. It is creating a driver instance with logging to
sys.stdout
enabled in theService
class. After instantiating the driver, it quits, and then creates another driver instance. This 2nd driver instance is totally unrelated to the first one, except for the fact that they both log tosys.stdout
. This should work becausedriver.quit()
closes thesys.stdout
file descriptor, so there should be no issue re-using it in the next instance:When I run this, I get:
It's not a race condition, because I tried adding a long sleep before instantiating the 2nd driver and I still get the same error.
This same error occurs with all other browsers besides Chrome, so it's not browser related.
What is going ON??
Reproducible Code
import sys from selenium import webdriver from selenium.webdriver.chrome.service import Service service = Service(log_output=sys.stdout) driver = webdriver.Chrome(service=service) driver.quit() service2 = Service(log_output=sys.stdout) driver2 = webdriver.Chrome(service=service2)
Debugging Logs
The text was updated successfully, but these errors were encountered: