Skip to content

Commit

Permalink
Remove useless warning log messages (log message level has been decre…
Browse files Browse the repository at this point in the history
…ased to debug).
  • Loading branch information
ssenart committed Apr 15, 2021
1 parent 4912330 commit 8155c91
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.25] - 2021-04-15
### Fixed
- Remove useless warning log messages (log message level has been decreased to debug).

## [0.1.24] - 2021-04-14
### Added
- README.md amendment (thanks to pbranly).
Expand Down Expand Up @@ -95,6 +99,7 @@ It occurs with the page containing 'Jour' button which is very long to load (I i
### Removed
- Remove Client.data property to get the updated data. Replaced with Client.__data private property.

[0.1.25]: https://github.com/ssenart/PyGazpar/compare/0.1.24...0.1.25
[0.1.24]: https://github.com/ssenart/PyGazpar/compare/0.1.23...0.1.24
[0.1.23]: https://github.com/ssenart/PyGazpar/compare/0.1.22...0.1.23
[0.1.22]: https://github.com/ssenart/PyGazpar/compare/0.1.21...0.1.22
Expand Down
10 changes: 8 additions & 2 deletions pygazpar/webdriverwrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ def find_element_by_id(self, id: str, description: str, screenshotOnNotFound: bo
WebDriverWrapper.logger.debug(f"find_element_by_id('{id}'): {description} -> Ok")
return res
except Exception:
WebDriverWrapper.logger.warning(f"find_element_by_id('{id}'): {description} -> Not found", exc_info=False)
message = f"find_element_by_id('{id}'): {description} -> Not found"
if screenshotOnNotFound:
WebDriverWrapper.logger.warning(message, exc_info=True)
self.__driver.save_screenshot(f"{self.__tmp_directory}/error_screenshot.png")
else:
WebDriverWrapper.logger.debug(message, exc_info=False)
raise

# ------------------------------------------------------
Expand All @@ -102,9 +105,12 @@ def find_element_by_xpath(self, xpath: str, description: str, screenshotOnNotFou
WebDriverWrapper.logger.debug(f"find_element_by_xpath('{xpath}'): {description} -> Ok")
return res
except Exception:
WebDriverWrapper.logger.warning(f"find_element_by_xpath('{xpath}'): {description} -> Not found", exc_info=False)
message = f"find_element_by_xpath('{xpath}'): {description} -> Not found"
if screenshotOnNotFound:
WebDriverWrapper.logger.warning(message, exc_info=True)
self.__driver.save_screenshot(f"{self.__tmp_directory}/error_screenshot.png")
else:
WebDriverWrapper.logger.debug(message, exc_info=False)
raise

# ------------------------------------------------------
Expand Down

0 comments on commit 8155c91

Please sign in to comment.