From e4d10cda0268c1272f22ee120c5d9db47e7fa7d4 Mon Sep 17 00:00:00 2001 From: John A Stevenson Date: Wed, 26 Jun 2024 10:13:38 +0100 Subject: [PATCH 1/2] Add link to log_to_console() --- docs/utilities.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/utilities.rst b/docs/utilities.rst index a9aee2f..a53b973 100644 --- a/docs/utilities.rst +++ b/docs/utilities.rst @@ -22,11 +22,13 @@ IDs) after INSERT statements. To capture these values, use the Log to console ^^^^^^^^^^^^^^ -ETL Helper provides a custom logging handler. Time-stamped messages -indicating the number of rows processed can be enabled by setting the -log level to ``INFO``. Setting the level to ``DEBUG`` provides +ETL Helper can be configured to send time-stamped log messages to the console via +a call to :func:`log_to_console() ` function. + +A log level of ``INFO`` reports progress, e.g. the number of rows processed. +Setting the level to ``DEBUG`` provides information on the query that was run, example data and the database -connection. To enable the logger, use: +connection. .. literalinclude:: code_demos/utilities/enable_logger.py :language: python From 45cf47fecd37e76fe31af10e564d977368462dbd Mon Sep 17 00:00:00 2001 From: John A Stevenson Date: Wed, 26 Jun 2024 16:41:11 +0100 Subject: [PATCH 2/2] Include log_to_console in API list --- etlhelper/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/etlhelper/__init__.py b/etlhelper/__init__.py index 57ce0eb..55fc378 100644 --- a/etlhelper/__init__.py +++ b/etlhelper/__init__.py @@ -97,6 +97,7 @@ def format(self, record: logging.LogRecord) -> str: "iter_chunks", "iter_rows", "load", + "log_to_console", "row_factories", "table_info", ]