mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
unified uvicorn access log entries too
This commit is contained in:
parent
c4a2808a4b
commit
e4c0102b3c
@ -223,10 +223,14 @@ def invoke_api():
|
|||||||
)
|
)
|
||||||
server = uvicorn.Server(config)
|
server = uvicorn.Server(config)
|
||||||
|
|
||||||
|
all_loggers = [logging.getLogger(name) for name in logging.root.manager.loggerDict]
|
||||||
|
|
||||||
# replace uvicorn's logger with InvokeAI's for consistent appearance
|
# replace uvicorn's logger with InvokeAI's for consistent appearance
|
||||||
logging.getLogger("uvicorn").handlers.clear()
|
for logname in ["uvicorn", "uvicorn.access", "uvicorn.error"]:
|
||||||
|
l = logging.getLogger(logname)
|
||||||
|
l.handlers.clear()
|
||||||
for ch in logger.handlers:
|
for ch in logger.handlers:
|
||||||
logging.getLogger("uvicorn").addHandler(ch)
|
l.addHandler(ch)
|
||||||
|
|
||||||
loop.run_until_complete(server.serve())
|
loop.run_until_complete(server.serve())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user