Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add link to log_to_console() #209

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
]
Loading