diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3f3b8684..b6e0afbd 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,11 @@ Changelog v1.4.? (??.??.2024) =================== +Feature +------- + +- Add logging whenever a sql statement is executed. + Fix --- diff --git a/py_experimenter/database_connector.py b/py_experimenter/database_connector.py index 0b86d8c8..83ccf6ba 100644 --- a/py_experimenter/database_connector.py +++ b/py_experimenter/database_connector.py @@ -50,8 +50,10 @@ def commit(self, connection) -> None: def execute(self, cursor, sql_statement, values=None) -> None: try: if values is None: + self.logger.debug(f"Executing sql statement: {sql_statement}") cursor.execute(sql_statement) else: + self.logger.debug(f"Executing sql statement: {sql_statement} with prepared statement values: {values}") cursor.execute(sql_statement, values) except Exception as e: raise DatabaseConnectionError(f"error \n{e}\n raised when executing sql statement.") diff --git a/pyproject.toml b/pyproject.toml index 63d65bef..ed4f4903 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "py-experimenter" -version = "1.4.1a0" +version = "1.4.1a1" description = "The PyExperimenter is a tool for the automatic execution of experiments, e.g. for machine learning (ML), capturing corresponding results in a unified manner in a database." authors = [ "Tanja Tornede ",