Fixed LogToIrc overriding default log level.

This commit is contained in:
Stéphan Kochen 2004-04-16 21:11:41 +00:00
parent 44899740a6
commit 4a5380b4f7

View File

@ -132,12 +132,19 @@ _ircHandler.setFormatter(_ircFormatter)
class IrcLogLevel(log.LogLevel): class IrcLogLevel(log.LogLevel):
"""Value must be one of INFO, WARNING, ERROR, or CRITICAL.""" """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): def setValue(self, v):
if v <= logging.DEBUG: if v <= logging.DEBUG:
self.error() self.error()
else: else:
log.LogLevel.setValue(self, v) log.LogLevel.setValue(self, v)
_ircHandler.setLevel(v)
class ValidChannelOrNick(registry.String): class ValidChannelOrNick(registry.String):
"""Value must be a valid channel or a valid nick.""" """Value must be a valid channel or a valid nick."""