- unified_logger.py: 删除 5 个从未使用的装饰器/函数 - internal_loggers.py: 删除 3 个未使用方法和工厂函数 - action_logger.py: 删除 3 个未使用方法 - log_formatter.py: 删除 6 个未使用格式化函数(保留 GUI 依赖的 4 个) - 同步更新 __init__.py 和测试文件 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
52 lines
1.2 KiB
Python
52 lines
1.2 KiB
Python
"""
|
||
日志相关模块的统一导入接口
|
||
|
||
提供完整的日志系统功能,包括:
|
||
- 日志格式化 (format_debug_log, format_action_log, 等)
|
||
- 性能追踪 (PerformanceTracker)
|
||
- 错误日志 (ErrorLogger)
|
||
- 调试日志 (DebugLogger)
|
||
- 行为日志 (ActionLogger)
|
||
- 操作追踪装饰器 (track_action)
|
||
"""
|
||
|
||
# 核心格式化模块
|
||
from .log_formatter import (
|
||
format_debug_log,
|
||
format_action_log,
|
||
format_error_log,
|
||
add_colors,
|
||
beautify_log_output,
|
||
colorize_log_line,
|
||
)
|
||
|
||
# 性能追踪模块
|
||
from .performance_tracker import PerformanceTracker
|
||
|
||
# 错误与调试日志(合并到 internal_loggers)
|
||
from .internal_loggers import ErrorLogger, DebugLogger
|
||
|
||
# 行为日志模块(含 track_action 装饰器)
|
||
from .action_logger import ActionLogger, track_action
|
||
|
||
# 日志包装器
|
||
from .douyin_logging_wrapper import LoggingWrapper
|
||
|
||
__all__ = [
|
||
# 格式化函数
|
||
"format_debug_log",
|
||
"format_action_log",
|
||
"format_error_log",
|
||
"add_colors",
|
||
"beautify_log_output",
|
||
"colorize_log_line",
|
||
# 类
|
||
"PerformanceTracker",
|
||
"ErrorLogger",
|
||
"DebugLogger",
|
||
"ActionLogger",
|
||
"LoggingWrapper",
|
||
# 装饰器和工具函数
|
||
"track_action",
|
||
]
|