partially address --root CLI argument handling

- fix places where `get_config()` is being called at import time rather
  than at run time.

- add regression test for import time get_config() calling.
This commit is contained in:
Lincoln Stein
2024-03-16 22:25:19 -04:00
committed by psychedelicious
parent 8cd65755ef
commit d871fca643
5 changed files with 24 additions and 11 deletions

View File

@ -339,7 +339,8 @@ class InvokeAILogger(object): # noqa D102
loggers: Dict[str, logging.Logger] = {}
@classmethod
def get_logger(cls, name: str = "InvokeAI", config: InvokeAIAppConfig = get_config()) -> logging.Logger: # noqa D102
def get_logger(cls, name: str = "InvokeAI", config: Optional[InvokeAIAppConfig] = None) -> logging.Logger: # noqa D102
config = config or get_config()
if name in cls.loggers:
return cls.loggers[name]