Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 11d5b75

Browse files
Fix example code for enabling logging in API change notice (#18094)
* MNT: Fix example code to enable logging. `set_level` doesn't exist, and nothing appears without a handler. * Add comment about addHandler Co-authored-by: Tim Hoffmann <[email protected]> Co-authored-by: Tim Hoffmann <[email protected]>
1 parent 580ae37 commit 11d5b75

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

doc/api/prev_api_changes/api_changes_3.1.0.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,11 @@ The following miscellaneous API elements have been removed
531531

532532
import logging
533533
logger = logging.getLogger('matplotlib')
534-
logger.set_level(logging.INFO)
534+
logger.setLevel(logging.INFO)
535+
# configure log handling: Either include it into your ``logging`` hierarchy,
536+
# e.g. by configuring a root looger using ``logging.basicConfig()``,
537+
# or add a standalone handler to the matplotlib logger:
538+
logger.addHandler(logging.StreamHandler())
535539

536540
- ``__version__numpy__``
537541
- ``collections.CIRCLE_AREA_FACTOR``

0 commit comments

Comments
 (0)