You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by cr...@apache.org on 2023/03/01 19:46:59 UTC

[superset] branch master updated: chore(webdriver): Tuning the Webdriver logging a bit (#23255)

This is an automated email from the ASF dual-hosted git repository.

craigrueda pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new d3e698eb54 chore(webdriver): Tuning the Webdriver logging a bit (#23255)
d3e698eb54 is described below

commit d3e698eb544f6f0a1edccf009db1b178b4eda9fa
Author: Craig Rueda <cr...@craigrueda.com>
AuthorDate: Wed Mar 1 11:46:49 2023 -0800

    chore(webdriver): Tuning the Webdriver logging a bit (#23255)
---
 superset/utils/webdriver.py | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/superset/utils/webdriver.py b/superset/utils/webdriver.py
index e678587029..92a73d347c 100644
--- a/superset/utils/webdriver.py
+++ b/superset/utils/webdriver.py
@@ -103,11 +103,9 @@ def find_unexpected_errors(driver: WebDriver) -> List[str]:
                     f"arguments[0].innerHTML = '{error_as_html}'", alert_div
                 )
             except WebDriverException:
-                logger.warning(
-                    "Failed to update error messages using alert_div", exc_info=True
-                )
+                logger.exception("Failed to update error messages using alert_div")
     except WebDriverException:
-        logger.warning("Failed to capture unexpected errors", exc_info=True)
+        logger.exception("Failed to capture unexpected errors")
 
     return error_messages
 
@@ -142,7 +140,7 @@ class WebDriverProxy:
             options.add_argument(arg)
 
         kwargs.update(current_app.config["WEBDRIVER_CONFIGURATION"])
-        logger.info("Init selenium driver")
+        logger.debug("Init selenium driver")
 
         return driver_class(**kwargs)
 
@@ -200,7 +198,7 @@ class WebDriverProxy:
             ]
             logger.debug("Wait %i seconds for chart animation", selenium_animation_wait)
             sleep(selenium_animation_wait)
-            logger.info(
+            logger.debug(
                 "Taking a PNG screenshot of url %s as user %s",
                 url,
                 user.username,
@@ -219,15 +217,16 @@ class WebDriverProxy:
             img = element.screenshot_as_png
 
         except TimeoutException:
-            logger.warning("Selenium timed out requesting url %s", url, exc_info=True)
+            logger.exception("Selenium timed out requesting url %s", url)
         except StaleElementReferenceException:
-            logger.error(
+            logger.exception(
                 "Selenium got a stale element while requesting url %s",
                 url,
-                exc_info=True,
             )
-        except WebDriverException as ex:
-            logger.error(ex, exc_info=True)
+        except WebDriverException:
+            logger.exception(
+                "Encountered an unexpected error when requeating url %s", url
+            )
         finally:
             self.destroy(driver, current_app.config["SCREENSHOT_SELENIUM_RETRIES"])
         return img