Skip to content
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

Fix log message on exception in UC Reactor #2105

Merged
merged 1 commit into from
Sep 13, 2023
Merged

Fix log message on exception in UC Reactor #2105

merged 1 commit into from
Sep 13, 2023

Conversation

jdholtz
Copy link
Contributor

@jdholtz jdholtz commented Sep 13, 2023

This bug took me a while to find, but the main problem it had is that it caused all my logging messages to print with the root logger in the program I use seleniumbase in. I included some code below that will show you the issue.

import logging
import logging.handlers
import time

from seleniumbase import Driver


logger = logging.getLogger("sub")
logger.setLevel(logging.DEBUG)

# Will not show up
logger.debug("debug")

driver = Driver(undetectable=True, uc_cdp_events=True)
driver.quit()

# Give time for the Reactor to stop
time.sleep(3)

# Without this fix, this message will show up even though the debug message before did not
logger.debug("Should not show up")

First, the exception didn't have a placeholder which caused a logging
exception. Also, logging.debug was called instead of logger.debug. This
had a side effect that all the debug messages after that would print to
the console, even when they didn't before.
@mdmintz mdmintz merged commit 2df116d into seleniumbase:master Sep 13, 2023
5 checks passed
@mdmintz
Copy link
Member

mdmintz commented Sep 13, 2023

It works. Merged. Thank you.

@mdmintz mdmintz added enhancement Making things better SeleniumBase 4 SeleniumBase 4 labels Sep 13, 2023
@mdmintz
Copy link
Member

mdmintz commented Sep 13, 2023

It'll be part of the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Making things better SeleniumBase 4 SeleniumBase 4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants