feat: Add logging and error handling enhancements
- Introduced new logging modules for action tracking, error logging, and performance tracking to improve observability. - Added functions for retrieving debug and error log paths in `path_config.py`. - Updated various components to utilize the new logging system, enhancing error handling and performance diagnostics. - Implemented a GUI component for viewing error logs, improving user experience in monitoring application issues. - Cleaned up unnecessary blank lines and improved code readability across multiple files.
This commit is contained in:
1 parent
bdf9312bc9
commit
efe6e2252f
48 files changed
+2165
-320
No files matched your search
@@ -80,3 +80,9 @@ class BaseFudaiMixin:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -35,3 +35,9 @@ class LotteryResultMixin:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -54,3 +54,9 @@ class RoomUtilsMixin:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -41,11 +41,11 @@ class StageDetectionMixin(BaseFudaiMixin):
|
||||
)
|
||||
return result # 明确返回以避免类型推断问题
|
||||
|
||||
def _check_in_live_room_by_icon(self) -> bool:
|
||||
def _check_in_live_room_by_icon(self) -> Tuple[bool, float]:
|
||||
"""通过检测直播间图标来判断是否在直播间内。
|
||||
|
||||
返回:
|
||||
bool: True 表示在直播间内,False 表示不在直播间内
|
||||
(detected, score): detected为bool表示是否在直播间内,score为置信度分数
|
||||
"""
|
||||
try:
|
||||
# 读取直播间图标区域的像素状态
|
||||
@@ -58,9 +58,9 @@ class StageDetectionMixin(BaseFudaiMixin):
|
||||
|
||||
# 如果检测到直播间相关阶段且置信度足够高
|
||||
if stage in ["LIVE_ROOM", "LIVE_ROOM_HAS_FUDAI"] and confidence > 0.7:
|
||||
return True
|
||||
return True, float(confidence)
|
||||
|
||||
return False
|
||||
return False, 0.0
|
||||
except Exception as e:
|
||||
self._safe_log(
|
||||
"阶段检测",
|
||||
@@ -68,7 +68,7 @@ class StageDetectionMixin(BaseFudaiMixin):
|
||||
error=str(e),
|
||||
level="WARNING"
|
||||
)
|
||||
return False
|
||||
return False, 0.0
|
||||
|
||||
def check_in_fudai_detail(self) -> bool:
|
||||
"""检查当前是否在福袋详情页面。
|
||||
|
||||
Reference in new issue
Block a user