From bb9f301410b13e5f50074818bba46b98d79797c5 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 26 May 2014 09:00:45 +0200 Subject: [PATCH] Use getattr to get numeric logging level. It turns out it was a bad idea to use logging._nameToLevel since that doesn't exist in python 3.3. --- qutebrowser/utils/log.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/qutebrowser/utils/log.py b/qutebrowser/utils/log.py index 468610962..d7f9909a7 100644 --- a/qutebrowser/utils/log.py +++ b/qutebrowser/utils/log.py @@ -57,9 +57,8 @@ def init_log(args): else args.logfilter.split(',')) level = 'DEBUG' if args.debug else args.loglevel.upper() try: - # pylint: disable=protected-access - numeric_level = logging._nameToLevel[level] - except KeyError: + numeric_level = getattr(logging, level) + except AttributeError: raise ValueError("Invalid log level: {}".format(args.loglevel)) simple_fmt = '{levelname}: {message}' extended_fmt = ('{asctime:8} {levelname:8} {name:10} {module}:{funcName}:'