diff --git a/humancursor/utilities/web_adjuster.py b/humancursor/utilities/web_adjuster.py index b511359..478771c 100644 --- a/humancursor/utilities/web_adjuster.py +++ b/humancursor/utilities/web_adjuster.py @@ -1,3 +1,4 @@ +import logging import random from selenium.common.exceptions import MoveTargetOutOfBoundsException @@ -8,6 +9,9 @@ from humancursor.utilities.calculate_and_randomize import generate_random_curve_parameters, calculate_absolute_offset +logger = logging.getLogger( "humancursor.utilities.web_adjuster" ) + + class WebAdjuster: def __init__(self, driver): self.__driver = driver @@ -117,7 +121,7 @@ def move_to( self.__action.perform() except MoveTargetOutOfBoundsException: self.__action.move_to_element(element_or_pos) - print( + logger.error( "MoveTargetOutOfBoundsException, Cursor Moved to Point, but without Human Trajectory!" ) diff --git a/humancursor/web_cursor.py b/humancursor/web_cursor.py index a259187..f279a59 100644 --- a/humancursor/web_cursor.py +++ b/humancursor/web_cursor.py @@ -1,3 +1,4 @@ +import logging from time import sleep import random @@ -7,6 +8,9 @@ from humancursor.utilities.web_adjuster import WebAdjuster +logger = logging.getLogger( "humancursor.web_cursor" ) + + class WebCursor: def __init__(self, driver): self.__driver = driver @@ -163,7 +167,7 @@ def scroll_into_view_of_element(self, element: WebElement): """User should input correct coordinates of x and y, cant take any action""" return True else: - print("Incorrect Element or Coordinates values!") + logger.warning("Incorrect Element or Coordinates values!") return False def show_cursor(self):