From 515dbcc5d9de572f46ebacb2baa47ae762b06036 Mon Sep 17 00:00:00 2001 From: Serg Date: Sat, 9 Feb 2019 20:05:51 +0300 Subject: [PATCH] Minor updates to log.py --- deluge/log.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/deluge/log.py b/deluge/log.py index 5c336b77a..75e8308b5 100644 --- a/deluge/log.py +++ b/deluge/log.py @@ -142,8 +142,8 @@ def setup_logger( """ if logging.getLoggerClass() is not Logging: logging.setLoggerClass(Logging) - logging.addLevelName(5, 'TRACE') - logging.addLevelName(1, 'GARBAGE') + logging.addLevelName(levels['trace'], 'TRACE') + logging.addLevelName(levels['garbage'], 'GARBAGE') level = levels.get(level, logging.ERROR) @@ -253,8 +253,8 @@ def set_logger_level(level, logger_name=None): :param level: str, a string representing the desired level :param logger_name: str, a string representing desired logger name for which - the level should change. The default is "None" will will - tweak the root logger level. + the level should change. The default is "None" will tweak + the root logger level. """ logging.getLogger(logger_name).setLevel(levels.get(level, 'error')) @@ -302,7 +302,8 @@ If you're the developer, please stop using the above code and instead use: The above will result in, regarding the "Label" plugin for example a log message similar to: 15:33:54 [deluge.plugins.label.core:78 ][INFO ] *** Start Label plugin *** -Triggering code:""" +Triggering code: +""" class _BackwardsCompatibleLOG(object):