From 2c37d0630aaa03f18a6b98af4d935218fcd87f33 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Sun, 21 Jan 2018 15:19:50 -0800 Subject: [PATCH] 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. --- lib/matplotlib/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index f97a8f39c755..2acd249e672d 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -382,7 +382,7 @@ def ge(self, level): return self.vald[self.level] >= self.vald[level] -def _wrap(fmt, func, level='INFO', always=True): +def _wrap(fmt, func, level='DEBUG', always=True): """ return a callable function that wraps func and reports its output through logger @@ -1131,7 +1131,7 @@ def rc_params_from_file(fname, fail_on_error=False, use_default_template=True): Please do not ask for support with these customizations active. ***************************************************************** """, '\n'.join(config['text.latex.preamble'])) - _log.info('loaded rc file %s', fname) + _log.debug('loaded rc file %s', fname) return config @@ -1839,7 +1839,7 @@ def inner(ax, *args, **kwargs): return param -_log.info('matplotlib version %s', __version__) -_log.info('interactive is %s', is_interactive()) -_log.info('platform is %s', sys.platform) +_log.debug('matplotlib version %s', __version__) +_log.debug('interactive is %s', is_interactive()) +_log.debug('platform is %s', sys.platform) _log.debug('loaded modules: %s', list(sys.modules))