From 3c7d1fcd323a3283a64784f584e73932f4cb8693 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Mon, 4 Dec 2023 22:41:59 -0500 Subject: [PATCH] clean up get_logger() call --- invokeai/app/api/routers/model_records.py | 2 +- invokeai/backend/util/logging.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/invokeai/app/api/routers/model_records.py b/invokeai/app/api/routers/model_records.py index cffca25d9f..87d8211d12 100644 --- a/invokeai/app/api/routers/model_records.py +++ b/invokeai/app/api/routers/model_records.py @@ -141,7 +141,7 @@ async def del_model_record( status_code=201, ) async def add_model_record( - config: Annotated[AnyModelConfig, Body(description="Model config", discriminator="type")] + config: Annotated[AnyModelConfig, Body(description="Model config", discriminator="type")], ) -> AnyModelConfig: """ Add a model using the configuration information appropriate for its type. diff --git a/invokeai/backend/util/logging.py b/invokeai/backend/util/logging.py index 67419bf834..c607e91835 100644 --- a/invokeai/backend/util/logging.py +++ b/invokeai/backend/util/logging.py @@ -343,12 +343,12 @@ class InvokeAILogger(object): # noqa D102 ) -> logging.Logger: # noqa D102 if name in cls.loggers: return cls.loggers[name] - else: - logger = logging.getLogger(name) + + logger = logging.getLogger(name) logger.setLevel(config.log_level.upper()) # yes, strings work here for ch in cls.get_loggers(config): logger.addHandler(ch) - cls.loggers[name] = logger + cls.loggers[name] = logger return cls.loggers[name] @classmethod