Skip to content
Merged
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
11 changes: 9 additions & 2 deletions pyprep/_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,15 @@ def setup_logging(level="info", *, stream=None, fmt=DEFAULT_FORMAT):

Notes
-----
To hand the output back afterwards, drop the handler again with
``logging.getLogger("pyprep").handlers.clear()``.
To hand the output back afterwards, drop the handler again and let the
records propagate::

logger = logging.getLogger("pyprep")
logger.handlers.clear()
logger.propagate = True

Clearing the handlers also removes any that the application attached to
this logger itself.
"""
logger = logging.getLogger(LOGGER_NAME)
logger.setLevel(_as_level(level))
Expand Down
Loading