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
@@ -1,7 +1,64 @@
|
||||
"""
|
||||
日志相关模块
|
||||
日志相关模块的统一导入接口
|
||||
|
||||
提供完整的日志系统功能,包括:
|
||||
- 日志格式化 (format_debug_log, format_action_log, 等)
|
||||
- 性能追踪 (PerformanceTracker)
|
||||
- 错误日志 (ErrorLogger)
|
||||
- 调试日志 (DebugLogger)
|
||||
- 行为日志 (ActionLogger)
|
||||
- 操作追踪装饰器 (track_action)
|
||||
"""
|
||||
|
||||
# 核心格式化模块
|
||||
from .log_formatter import (
|
||||
format_debug_log,
|
||||
format_action_log,
|
||||
format_call_stack,
|
||||
format_parameters,
|
||||
format_variables,
|
||||
format_exception,
|
||||
add_separators,
|
||||
add_colors,
|
||||
)
|
||||
|
||||
# 性能追踪模块
|
||||
from .performance_tracker import PerformanceTracker
|
||||
|
||||
# 错误日志模块
|
||||
from .error_logger import ErrorLogger
|
||||
|
||||
# 调试日志模块
|
||||
from .debug_logger import DebugLogger, _get_debug_logger
|
||||
|
||||
# 行为日志模块
|
||||
from .action_logger import ActionLogger
|
||||
|
||||
# 操作追踪装饰器
|
||||
from .action_tracker import track_action
|
||||
|
||||
__all__ = [
|
||||
# 格式化函数
|
||||
"format_debug_log",
|
||||
"format_action_log",
|
||||
"format_call_stack",
|
||||
"format_parameters",
|
||||
"format_variables",
|
||||
"format_exception",
|
||||
"add_separators",
|
||||
"add_colors",
|
||||
|
||||
# 类
|
||||
"PerformanceTracker",
|
||||
"ErrorLogger",
|
||||
"DebugLogger",
|
||||
"ActionLogger",
|
||||
|
||||
# 装饰器和工具函数
|
||||
"track_action",
|
||||
"_get_debug_logger",
|
||||
]
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user