From ba6ddcb188f176fc1fe83682e4203654502ed13b Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Fri, 9 Mar 2018 08:02:28 -0800 Subject: [PATCH] Backport PR #10734: 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 86776dd3069a..0a538e72a4dd 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='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 @@ -396,8 +396,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