Skip to content

Commit

Permalink
Merge pull request #209 from BritishGeologicalSurvey/dummy-merge-request
Browse files Browse the repository at this point in the history
Add link to log_to_console()
  • Loading branch information
volcan01010 authored Jun 26, 2024
2 parents d0de851 + 45cf47f commit a4d823c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/utilities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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() <etlhelper.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
Expand Down
1 change: 1 addition & 0 deletions etlhelper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def format(self, record: logging.LogRecord) -> str:
"iter_chunks",
"iter_rows",
"load",
"log_to_console",
"row_factories",
"table_info",
]

0 comments on commit a4d823c

Please sign in to comment.