Skip to content

Commit

Permalink
MNT Remove sklearn logger default StreamHandler (scikit-learn#16451)
Browse files Browse the repository at this point in the history
* Remove sklearn logger default StreamHandler

To avoid duplicate log messages

* DOC Adds whats_new

* CLN Address comments

* MNT Remove setLevel

Co-authored-by: Thomas J Fan <thomasjpfan@gmail.com>
  • Loading branch information
2 people authored and gio8tisu committed May 15, 2020
1 parent 41c0bab commit 9988bc7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 6 additions & 0 deletions doc/whats_new/v0.23.rst
Expand Up @@ -195,6 +195,12 @@ Changelog
`ValueError` for arguments `n_classes < 1` OR `length < 1`.
:pr:`16006` by :user:`Rushabh Vasani <rushabh-v>`.

- |API| The `StreamHandler` was removed from `sklearn.logger` to avoid
double logging of messages in common cases where a hander is attached
to the root logger, and to follow the Python logging documentation
recommendation for libraries to leave the log message handling to
users and application code. :pr:`16451` by :user:`Christoph Deil <cdeil>`.

:mod:`sklearn.decomposition`
............................

Expand Down
2 changes: 0 additions & 2 deletions sklearn/__init__.py
Expand Up @@ -19,8 +19,6 @@
from ._config import get_config, set_config, config_context

logger = logging.getLogger(__name__)
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.INFO)


# PEP0440 compatible formatted version, see:
Expand Down

0 comments on commit 9988bc7

Please sign in to comment.