set log level after config init

This commit is contained in:
Robert Kaussow 2019-10-08 11:43:55 +02:00
parent 3a525bcad8
commit 8c89453bf6

View File

@ -57,12 +57,13 @@ class AnsibleDoctor:
except ansibledoctor.Exception.ConfigError as e:
self.log.sysexit_with_message(e)
self.log.set_level(config.config["logging"]["level"])
if config.is_role:
self.logger.info("Ansible role detected")
else:
self.log.sysexit_with_message("No Ansible role detected")
self.log.set_level(config.config["logging"]["level"])
self.logger.info("Using config file {}".format(config.config_file))
return config