logexc
This commit is contained in:
parent
8b398fa589
commit
e1a8c7c986
|
@ -1,5 +1,7 @@
|
||||||
import sys
|
import sys
|
||||||
import uvicorn
|
import uvicorn
|
||||||
|
from uvicorn.main import logger
|
||||||
|
|
||||||
from settings import PORT
|
from settings import PORT
|
||||||
|
|
||||||
log_settings = {
|
log_settings = {
|
||||||
|
@ -47,9 +49,10 @@ local_headers = [
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def exception_handler(exception_type, exception, traceback, debug_hook=sys.excepthook):
|
def exception_handler(exception_type, exc, traceback, debug_hook=sys.excepthook):
|
||||||
print(traceback)
|
print(traceback)
|
||||||
print("%s: %s" % (exception_type.__name__, exception))
|
print("%s: %s" % (exc.__name__, exc))
|
||||||
|
logger.error(..., exc_info=(type(exc), exc, exc.__traceback__))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in New Issue
Block a user