mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
add module-level getLogger() method
This commit is contained in:
parent
f904f14f9e
commit
f3081e7013
@ -54,13 +54,16 @@ def disable(level=logging.CRITICAL):
|
|||||||
def basicConfig(**kwargs):
|
def basicConfig(**kwargs):
|
||||||
InvokeAILogger.getLogger().basicConfig(**kwargs)
|
InvokeAILogger.getLogger().basicConfig(**kwargs)
|
||||||
|
|
||||||
|
def getLogger(name: str=None)->logging.Logger:
|
||||||
|
return InvokeAILogger.getLogger(name)
|
||||||
|
|
||||||
class InvokeAILogFormatter(logging.Formatter):
|
class InvokeAILogFormatter(logging.Formatter):
|
||||||
'''
|
'''
|
||||||
Repurposed from:
|
Repurposed from:
|
||||||
https://stackoverflow.com/questions/14844970/modifying-logging-message-format-based-on-message-logging-level-in-python3
|
https://stackoverflow.com/questions/14844970/modifying-logging-message-format-based-on-message-logging-level-in-python3
|
||||||
'''
|
'''
|
||||||
crit_fmt = "### %(msg)s"
|
crit_fmt = "### %(msg)s"
|
||||||
err_fmt = "!!! %(msg)s !!!"
|
err_fmt = "*** %(msg)s"
|
||||||
warn_fmt = "** %(msg)s"
|
warn_fmt = "** %(msg)s"
|
||||||
info_fmt = ">> %(msg)s"
|
info_fmt = ">> %(msg)s"
|
||||||
dbg_fmt = " | %(msg)s"
|
dbg_fmt = " | %(msg)s"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user