From 9a017f75e96aa9871a9c65629027a12d100f19bc Mon Sep 17 00:00:00 2001 From: Hay1tsme Date: Fri, 17 Nov 2023 10:57:12 -0500 Subject: [PATCH] wacca: add traceback printing --- titles/wacca/index.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/titles/wacca/index.py b/titles/wacca/index.py index a3a0655..61c7272 100644 --- a/titles/wacca/index.py +++ b/titles/wacca/index.py @@ -7,6 +7,7 @@ from hashlib import md5 from twisted.web.http import Request from typing import Dict, Tuple, List from os import path +import traceback from core import CoreConfig, Utils from .config import WaccaConfig @@ -173,8 +174,10 @@ class WaccaServlet: self.logger.error( f"{req_json['appVersion']} Error handling method {url_path} -> {e}" ) - if self.core_cfg.server.is_develop: - raise + if self.logger.level == logging.DEBUG: + traceback.print_exception(e, limit=1) + with open("{0}/{1}.log".format(self.core_cfg.server.log_dir, "wacca"), "a") as f: + traceback.print_exception(e, limit=1, file=f) resp = BaseResponse() resp.status = 1