add get_logger() as alias for getLogger()

This commit is contained in:
Lincoln Stein 2023-08-14 20:18:09 -04:00
parent 6eaaa75a5d
commit cab8239ba8

View File

@ -228,7 +228,6 @@ def basicConfig(**kwargs):
def getLogger(name: str = None) -> logging.Logger: def getLogger(name: str = None) -> logging.Logger:
return InvokeAILogger.getLogger(name) return InvokeAILogger.getLogger(name)
_FACILITY_MAP = ( _FACILITY_MAP = (
dict( dict(
LOG_KERN=syslog.LOG_KERN, LOG_KERN=syslog.LOG_KERN,
@ -366,6 +365,11 @@ class InvokeAILogger(object):
cls.loggers[name] = logger cls.loggers[name] = logger
return cls.loggers[name] return cls.loggers[name]
# same thing without the camel case
@classmethod
def get_logger(cls, *arg, **kwarg) -> logging.Logger:
return cls.getLogger(*arg, **kwarg)
@classmethod @classmethod
def getLoggers(cls, config: InvokeAIAppConfig) -> list[logging.Handler]: def getLoggers(cls, config: InvokeAIAppConfig) -> list[logging.Handler]:
handler_strs = config.log_handlers handler_strs = config.log_handlers