add log
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m58s

This commit is contained in:
zyc 2026-03-13 11:24:35 +08:00
parent dd7b693c0b
commit 9896c0dff0

View File

@ -8,7 +8,7 @@ from urllib.request import Request, urlopen
from urllib.error import URLError from urllib.error import URLError
LOG_CENTER_URL = os.getenv('LOG_CENTER_URL', 'https://qiyuan-log-center-api.airlabs.art') LOG_CENTER_URL = os.getenv('LOG_CENTER_URL', 'https://qiyuan-log-center-api.airlabs.art')
LOG_CENTER_ENABLED = os.getenv('LOG_CENTER_ENABLED', 'true').lower() in ('true', '1', 'yes') LOG_CENTER_ENABLED = os.getenv('LOG_CENTER_ENABLED', 'false').lower() in ('true', '1', 'yes')
PROJECT_ID = 'video_backend' PROJECT_ID = 'video_backend'
ENVIRONMENT = os.getenv('ENVIRONMENT', 'development') ENVIRONMENT = os.getenv('ENVIRONMENT', 'development')
@ -30,7 +30,7 @@ def report_error(exc, context=None):
'message': str(exc), 'message': str(exc),
'file_path': last_frame.filename if last_frame else 'unknown', 'file_path': last_frame.filename if last_frame else 'unknown',
'line_number': last_frame.lineno if last_frame else 0, 'line_number': last_frame.lineno if last_frame else 0,
'stack_trace': traceback.format_exception(exc), 'stack_trace': ''.join(traceback.format_exception(exc)),
}, },
'context': context or {}, 'context': context or {},
} }