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

Skip to content

Commit 2c37d06

Browse files
committed
Move down logging levels in mpl/__init__ to DEBUG.
Most "info" level logs in the codebase are either reporting "mildly" invalid conditions that mpl can easily work around, or initializations that occur relatively rarely. On the contrary, mpl/__init__ is run every time mpl is imported and reports on completely normal stuff. Moving the levels of the logs in mpl/__init__ down to DEBUG makes it possible to have a globally activated logger at the INFO level (see e.g. https://coloredlogs.readthedocs.io/en/latest/ specifically https://coloredlogs.readthedocs.io/en/latest/#environment-variables) without it being spammed by matplotlib.
1 parent af1197d commit 2c37d06

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

lib/matplotlib/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def ge(self, level):
382382
return self.vald[self.level] >= self.vald[level]
383383

384384

385-
def _wrap(fmt, func, level='INFO', always=True):
385+
def _wrap(fmt, func, level='DEBUG', always=True):
386386
"""
387387
return a callable function that wraps func and reports its
388388
output through logger
@@ -1131,7 +1131,7 @@ def rc_params_from_file(fname, fail_on_error=False, use_default_template=True):
11311131
Please do not ask for support with these customizations active.
11321132
*****************************************************************
11331133
""", '\n'.join(config['text.latex.preamble']))
1134-
_log.info('loaded rc file %s', fname)
1134+
_log.debug('loaded rc file %s', fname)
11351135

11361136
return config
11371137

@@ -1839,7 +1839,7 @@ def inner(ax, *args, **kwargs):
18391839

18401840
return param
18411841

1842-
_log.info('matplotlib version %s', __version__)
1843-
_log.info('interactive is %s', is_interactive())
1844-
_log.info('platform is %s', sys.platform)
1842+
_log.debug('matplotlib version %s', __version__)
1843+
_log.debug('interactive is %s', is_interactive())
1844+
_log.debug('platform is %s', sys.platform)
18451845
_log.debug('loaded modules: %s', list(sys.modules))

0 commit comments

Comments
 (0)