This commit is contained in:
josc146 2023-06-13 22:47:17 +08:00
parent 631704d04d
commit 714b8834c7
2 changed files with 18 additions and 12 deletions

View File

@ -15,18 +15,24 @@ logger.addHandler(fh)
def quick_log(request: Request, body: Any, response: str):
logger.info(
f"Client: {request.client if request else ''}\nUrl: {request.url if request else ''}\n"
+ (
f"Body: {json.dumps(body.__dict__, default=vars, ensure_ascii=False)}\n"
if body
else ""
try:
logger.info(
f"Client: {request.client if request else ''}\nUrl: {request.url if request else ''}\n"
+ (
f"Body: {json.dumps(body.__dict__, default=vars, ensure_ascii=False)}\n"
if body
else ""
)
+ (f"Data:\n{response}\n" if response else "")
)
+ (f"Data:\n{response}\n" if response else "")
)
except Exception as e:
logger.info(f"Error quick_log request:\n{e}")
async def log_middleware(request: Request):
logger.info(
f"Client: {request.client}\nUrl: {request.url}\nBody: {await request.body()}\n"
)
try:
logger.info(
f"Client: {request.client}\nUrl: {request.url}\nBody: {await request.body()}\n"
)
except Exception as e:
logger.info(f"Error log_middleware request:\n{e}")

View File

@ -250,7 +250,7 @@ export async function checkUpdate(notifyEvenLatest: boolean = false) {
toast(t('Downloading update, please wait. If it is not completed, please manually download the program from GitHub and replace the original program.'), {
type: 'info',
position: 'bottom-left',
autoClose: 30000
autoClose: false
});
setTimeout(() => {
UpdateApp(updateUrl).then(() => {