more loglevel output
This commit is contained in:
parent
f95f33ba71
commit
accbb7c515
1 changed files with 4 additions and 2 deletions
|
@ -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"]))
|
||||
|
|
Loading…
Reference in a new issue