This commit is contained in:
2023-10-04 20:14:06 +03:00
parent 34b7d0021d
commit 1360692b57
6 changed files with 42 additions and 38 deletions

View File

@@ -2,12 +2,6 @@ import sys
import uvicorn
from settings import PORT
def exception_handler(exception_type, exception, traceback, debug_hook=sys.excepthook):
print(vars(traceback))
print("%s: %s" % (exception_type.__name__, exception))
log_settings = {
"version": 1,
"disable_existing_loggers": True,
@@ -53,6 +47,11 @@ local_headers = [
]
def exception_handler(exception_type, exception, traceback, debug_hook=sys.excepthook):
traceback.print_exc()
print("%s: %s" % (exception_type.__name__, exception))
if __name__ == "__main__":
sys.excepthook = exception_handler
uvicorn.run(