Fix log level setting for cli

This commit is contained in:
avollkopf 2022-11-27 15:16:18 +01:00
parent f13993db31
commit 05b70e3cd7
3 changed files with 5 additions and 4 deletions

View file

@ -1,3 +1,3 @@
__version__ = "4.0.7.a9" __version__ = "4.0.7.a10"
__codename__ = "Spring Break" __codename__ = "November Rain"

View file

@ -239,8 +239,9 @@ def main(context, config_folder_path, logs_folder_path, debug_log_level):
if logs_folder_path == "": if logs_folder_path == "":
logs_folder_path = os.path.join(Path(config_folder_path).absolute().parent, 'logs') logs_folder_path = os.path.join(Path(config_folder_path).absolute().parent, 'logs')
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(name)s - %(message)s') formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(name)s - %(message)s')
logging.basicConfig(format=formatter,level=debug_log_level, stream=logging.StreamHandler()) logging.basicConfig(format=formatter, stream=logging.StreamHandler())
logger = logging.getLogger() logger = logging.getLogger()
logger.setLevel(debug_log_level)
try: try:
if not os.path.isdir(logs_folder_path): if not os.path.isdir(logs_folder_path):
logger.info(f"logs folder '{logs_folder_path}' doesnt exist and we are trying to create it") logger.info(f"logs folder '{logs_folder_path}' doesnt exist and we are trying to create it")

View file

@ -297,7 +297,7 @@ class CraftBeerPi:
await self.kettle.init() await self.kettle.init()
await self.call_initializer(self.app) await self.call_initializer(self.app)
await self.dashboard.init() await self.dashboard.init()
self._swagger_setup() self._swagger_setup()