mypy: Fix logging.VDEBUG issues
This commit is contained in:
parent
0999945af4
commit
4d1b3df5e0
@ -76,12 +76,13 @@ LOG_COLORS = {
|
|||||||
|
|
||||||
# We first monkey-patch logging to support our VDEBUG level before getting the
|
# We first monkey-patch logging to support our VDEBUG level before getting the
|
||||||
# loggers. Based on http://stackoverflow.com/a/13638084
|
# loggers. Based on http://stackoverflow.com/a/13638084
|
||||||
|
# mypy doesn't know about this, so we need to ignore it.
|
||||||
VDEBUG_LEVEL = 9
|
VDEBUG_LEVEL = 9
|
||||||
logging.addLevelName(VDEBUG_LEVEL, 'VDEBUG')
|
logging.addLevelName(VDEBUG_LEVEL, 'VDEBUG')
|
||||||
logging.VDEBUG = VDEBUG_LEVEL
|
logging.VDEBUG = VDEBUG_LEVEL # type: ignore
|
||||||
|
|
||||||
LOG_LEVELS = {
|
LOG_LEVELS = {
|
||||||
'VDEBUG': logging.VDEBUG,
|
'VDEBUG': logging.VDEBUG, # type: ignore
|
||||||
'DEBUG': logging.DEBUG,
|
'DEBUG': logging.DEBUG,
|
||||||
'INFO': logging.INFO,
|
'INFO': logging.INFO,
|
||||||
'WARNING': logging.WARNING,
|
'WARNING': logging.WARNING,
|
||||||
@ -89,17 +90,6 @@ LOG_LEVELS = {
|
|||||||
'CRITICAL': logging.CRITICAL,
|
'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):
|
def vdebug(self, msg, *args, **kwargs):
|
||||||
"""Log with a VDEBUG level.
|
"""Log with a VDEBUG level.
|
||||||
@ -114,7 +104,7 @@ def vdebug(self, msg, *args, **kwargs):
|
|||||||
# pylint: enable=protected-access
|
# pylint: enable=protected-access
|
||||||
|
|
||||||
|
|
||||||
logging.Logger.vdebug = vdebug
|
logging.Logger.vdebug = vdebug # type: ignore
|
||||||
|
|
||||||
|
|
||||||
# The different loggers used.
|
# The different loggers used.
|
||||||
@ -148,6 +138,17 @@ network = logging.getLogger('network')
|
|||||||
sql = logging.getLogger('sql')
|
sql = logging.getLogger('sql')
|
||||||
greasemonkey = logging.getLogger('greasemonkey')
|
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
|
ram_handler = None
|
||||||
console_handler = None
|
console_handler = None
|
||||||
|
Loading…
Reference in New Issue
Block a user