👍️[Update] Main : error logのトレースバックの処理を集約
This commit is contained in:
@@ -4,6 +4,7 @@ import json
|
||||
import random
|
||||
from typing import Union
|
||||
from os import path as os_path, rename as os_rename
|
||||
import traceback
|
||||
from PIL.Image import open as Image_open
|
||||
|
||||
def getImageFile(file_name):
|
||||
@@ -93,4 +94,9 @@ def printResponse(status:int, endpoint:str, result:Any=None) -> None:
|
||||
f.write(f"log: {response}\n")
|
||||
|
||||
response = json.dumps(response)
|
||||
print(response, flush=True)
|
||||
print(response, flush=True)
|
||||
|
||||
def errorLogging(error:Exception) -> None:
|
||||
with open('error.log', 'a') as f:
|
||||
f.write(f"error: {error}\n")
|
||||
traceback.print_exc(file=f)
|
||||
Reference in New Issue
Block a user