diff --git a/qutebrowser/utils/log.py b/qutebrowser/utils/log.py index 381e9ca5d..a1c4f74b7 100644 --- a/qutebrowser/utils/log.py +++ b/qutebrowser/utils/log.py @@ -76,12 +76,13 @@ LOG_COLORS = { # We first monkey-patch logging to support our VDEBUG level before getting the # loggers. Based on http://stackoverflow.com/a/13638084 +# mypy doesn't know about this, so we need to ignore it. VDEBUG_LEVEL = 9 logging.addLevelName(VDEBUG_LEVEL, 'VDEBUG') -logging.VDEBUG = VDEBUG_LEVEL +logging.VDEBUG = VDEBUG_LEVEL # type: ignore LOG_LEVELS = { - 'VDEBUG': logging.VDEBUG, + 'VDEBUG': logging.VDEBUG, # type: ignore 'DEBUG': logging.DEBUG, 'INFO': logging.INFO, 'WARNING': logging.WARNING, @@ -89,17 +90,6 @@ LOG_LEVELS = { 'CRITICAL': logging.CRITICAL, } -LOGGER_NAMES = [ - 'statusbar', 'completion', 'init', 'url', - 'destroy', 'modes', 'webview', 'misc', - 'mouse', 'procs', 'hints', 'keyboard', - 'commands', 'signals', 'downloads', - 'js', 'qt', 'rfc6266', 'ipc', 'shlexer', - 'save', 'message', 'config', 'sessions', - 'webelem', 'prompt', 'network', 'sql', - 'greasemonkey' -] - def vdebug(self, msg, *args, **kwargs): """Log with a VDEBUG level. @@ -114,7 +104,7 @@ def vdebug(self, msg, *args, **kwargs): # pylint: enable=protected-access -logging.Logger.vdebug = vdebug +logging.Logger.vdebug = vdebug # type: ignore # The different loggers used. @@ -148,6 +138,17 @@ network = logging.getLogger('network') sql = logging.getLogger('sql') greasemonkey = logging.getLogger('greasemonkey') +LOGGER_NAMES = [ + 'statusbar', 'completion', 'init', 'url', + 'destroy', 'modes', 'webview', 'misc', + 'mouse', 'procs', 'hints', 'keyboard', + 'commands', 'signals', 'downloads', + 'js', 'qt', 'rfc6266', 'ipc', 'shlexer', + 'save', 'message', 'config', 'sessions', + 'webelem', 'prompt', 'network', 'sql', + 'greasemonkey' +] + ram_handler = None console_handler = None