From 4a5380b4f754948a7f4960eec4d3d82f2b14f66a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Kochen?= Date: Fri, 16 Apr 2004 21:11:41 +0000 Subject: [PATCH] Fixed LogToIrc overriding default log level. --- plugins/LogToIrc.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/LogToIrc.py b/plugins/LogToIrc.py index 34591450c..562831c53 100644 --- a/plugins/LogToIrc.py +++ b/plugins/LogToIrc.py @@ -132,12 +132,19 @@ _ircHandler.setFormatter(_ircFormatter) class IrcLogLevel(log.LogLevel): """Value must be one of INFO, WARNING, ERROR, or CRITICAL.""" + def set(self, s): + s = s.upper() + try: + self.setValue(getattr(logging, s)) + _ircHandler.setLevel(self.value) + except AttributeError: + self.error() + def setValue(self, v): if v <= logging.DEBUG: self.error() else: log.LogLevel.setValue(self, v) - _ircHandler.setLevel(v) class ValidChannelOrNick(registry.String): """Value must be a valid channel or a valid nick."""