X-Git-Url: http://git.tremily.us/?a=blobdiff_plain;f=hooke%2Fconfig.py;h=5948974f101c4ef647612f121fb3c6c69cd34af6;hb=96766f847b6de124dfd1b96eb6e349fdb71a0199;hp=0135f6bd35e9ca05f5ac436ed8f492436cd1597b;hpb=1a32c188d1687b766ff7c9f0ef43abd3a4e02e89;p=hooke.git diff --git a/hooke/config.py b/hooke/config.py index 0135f6b..5948974 100644 --- a/hooke/config.py +++ b/hooke/config.py @@ -106,7 +106,7 @@ DEFAULT_SETTINGS = [ Setting('logger_hooke', 'qualname', 'hooke'), Setting('handler_hand1', help='Configure the default log handler, see\nhttp://docs.python.org/library/logging.html#configuration-file-format', wrap=False), Setting('handler_hand1', 'class', 'StreamHandler'), - Setting('handler_hand1', 'level', 'NOTSET'), + Setting('handler_hand1', 'level', 'WARN'), Setting('handler_hand1', 'formatter', 'form1'), Setting('handler_hand1', 'args', '(sys.stderr,)'), Setting('formatter_form1', help='Configure the default log formatter, see\nhttp://docs.python.org/library/logging.html#configuration-file-format', wrap=False), @@ -300,12 +300,16 @@ class HookeConfigParser (configparser.RawConfigParser): self, section, *args, **kwargs) for i,kv in enumerate(items): key,value = kv - setting = self._default_settings_dict[(section, key)] + log = logging.getLogger('hooke') + try: + setting = self._default_settings_dict[(section, key)] + except KeyError, e: + log.error('unknown setting %s/%s: %s' % (section, key, e)) + raise try: items[i] = (key, from_string(value=value, type=setting.type, count=setting.count)) except ValueError, e: - log = logging.getLogger('hooke') log.error("could not convert '%s' (%s) for %s/%s: %s" % (value, type(value), section, key, e)) raise