From df2aacf917eff22629973f60270828019eb09d7a Mon Sep 17 00:00:00 2001 From: gregorybchris Date: Fri, 9 Mar 2018 00:16:34 -0500 Subject: [PATCH] Fix logging level type --- lib/matplotlib/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index cb78d8d1eb06..b02bb7548944 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -391,7 +391,7 @@ def ge(self, level): return self.vald[self.level] >= self.vald[level] -def _wrap(fmt, func, level='DEBUG', always=True): +def _wrap(fmt, func, level=logging.DEBUG, always=True): """ return a callable function that wraps func and reports its output through logger @@ -405,8 +405,7 @@ def wrapper(*args, **kwargs): ret = func(*args, **kwargs) if (always or not wrapper._spoke): - lvl = logging.getLevelName(level.upper()) - _log.log(lvl, fmt % ret) + _log.log(level, fmt % ret) spoke = True if not wrapper._spoke: wrapper._spoke = spoke