From e127a9575f075e906c6cce7f16a7f5f80f5b2272 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 13 Apr 2004 05:19:56 +0000 Subject: [PATCH] Updated LogLevel. --- src/log.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/log.py b/src/log.py index 0da907da2..0ebd8f2ec 100644 --- a/src/log.py +++ b/src/log.py @@ -217,15 +217,16 @@ class MetaFirewall(type): class LogLevel(registry.Value): + """Invalid log level. Value must be either DEBUG, INFO, WARNING, ERROR, + or CRITICAL.""" def set(self, s): s = s.upper() try: - self.value = getattr(logging, s) + self.setValue(getattr(logging, s)) _logger.setLevel(self.value) # _logger defined later. except AttributeError: - s = 'Invalid log level: should be one of ' \ - 'DEBUG, INFO, WARNING, ERROR, or CRITICAL.' - raise registry.InvalidRegistryValue, s + self.error() + def __str__(self): return logging.getLevelName(self.value)