more loglevel output

This commit is contained in:
age 2006-08-22 08:00:32 +00:00
parent f95f33ba71
commit accbb7c515

View file

@ -101,8 +101,10 @@ class CryptoBox:
# get the loglevel
try:
log_level = self.cbxPrefs["Log"]["Level"].upper()
if not log_level in ["DEBUG", "INFO", "WARN", "ERROR"]:
self.log.error("invalid log level: %s" % self.cbxPrefs["Log"]["Level"])
log_level_avail = ["DEBUG", "INFO", "WARN", "ERROR"]
#if not log_level in ["DEBUG", "INFO", "WARN", "ERROR"]:
if not log_level in log_level_avail:
self.log.error("invalid log level: %s is not in %s" % (self.cbxPrefs["Log"]["Level"], log_level_avail))
sys.exit(1)
self.log.setLevel(getattr(logging, log_level))
self.log.addHandler(logging.FileHandler(self.cbxPrefs["Log"]["Details"]))