From 8f3aff9a85ff00b6e1df860ff8cc399a8ed9b7bb Mon Sep 17 00:00:00 2001 From: naisanzaa Date: Mon, 7 Oct 2024 23:33:09 +0800 Subject: [PATCH] selenium: update cookie logging --- automon/integrations/seleniumWrapper/browser.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/automon/integrations/seleniumWrapper/browser.py b/automon/integrations/seleniumWrapper/browser.py index 8253deb2..d883878a 100644 --- a/automon/integrations/seleniumWrapper/browser.py +++ b/automon/integrations/seleniumWrapper/browser.py @@ -300,17 +300,17 @@ def action_type_down( raise Exception(f'action_type_down :: failed :: {error=} :: {key=}') def add_cookie(self, cookie_dict: dict) -> bool: - logger.debug(f'add_cookie :: {cookie_dict=}') + logger.debug( + f'add_cookie :: {cookie_dict.get("domain")} :: ' + f'{cookie_dict.get("path")} :: ' + f'{cookie_dict.get("secure")} :: ' + f'{cookie_dict.get("expiry")} :: ' + f'{cookie_dict.get("name")}' + ) result = self.webdriver.add_cookie(cookie_dict=cookie_dict) if result is None: - logger.debug(f'add_cookie :: domain :: {cookie_dict.get("domain")}') - logger.debug(f'add_cookie :: path :: {cookie_dict.get("path")}') - logger.debug(f'add_cookie :: secure :: {cookie_dict.get("secure")}') - logger.debug(f'add_cookie :: expiry :: {cookie_dict.get("expiry")}') - logger.debug(f'add_cookie :: name :: {cookie_dict.get("name")}') - logger.info(f'add_cookie :: done') return True @@ -331,11 +331,9 @@ def add_cookie_from_file(self, file: str) -> bool: def add_cookies_from_list(self, cookies_list: list) -> bool: """add cookies from a list of cookies""" - logger.debug(f'add_cookies_from_list :: start') logger.debug(f'add_cookies_from_list :: {len(cookies_list)} cookies found') for cookie in cookies_list: - logger.debug(f'add_cookies_from_list :: {cookie=}') self.add_cookie(cookie_dict=cookie) logger.debug(f'add_cookies_from_list :: {len(cookies_list)} cookies added')